Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

include file variables not intialized in Plugins

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
qudoos
Smarty Rookie


Joined: 25 Dec 2004
Posts: 5

PostPosted: Thu Dec 30, 2004 1:27 am    Post subject: include file variables not intialized in Plugins Reply with quote

Hi,

I am writing a few plugins for my application.

I have a functions.php file. I want to use these functions in some of my plugins.

I also want to use some site variables that I initialize in my config.php file. On including both files I am able to access the functions but not the variables.

I cannot re-declare these varibales in all my plugins everytime.

Is there a way to achieve this, or a work around?

if details are required, please let me know.

thanks.

Qudoos
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Dec 30, 2004 7:48 pm    Post subject: Reply with quote

the easiest may be if you include your config.php in global scope (outside of smarty, maybe at the beginning of your php-script). and then declare all variables you want to use as global inside plugin's function.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
qudoos
Smarty Rookie


Joined: 25 Dec 2004
Posts: 5

PostPosted: Fri Dec 31, 2004 2:40 pm    Post subject: Reply with quote

Thanks. That works. Just had to declare them global in function scope.

Turns out it is me not knowing PHP, instead of smarty.Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP