|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
qudoos Smarty Rookie
Joined: 25 Dec 2004 Posts: 5
|
Posted: Thu Dec 30, 2004 1:27 am Post subject: include file variables not intialized in Plugins |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Dec 30, 2004 7:48 pm Post subject: |
|
|
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 |
|
qudoos Smarty Rookie
Joined: 25 Dec 2004 Posts: 5
|
Posted: Fri Dec 31, 2004 2:40 pm Post subject: |
|
|
Thanks. That works. Just had to declare them global in function scope.
Turns out it is me not knowing PHP, instead of smarty. |
|
Back to top |
|
|
|
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
|