Re: [SMARTY] Smarty global variables
| From: | Jason Sweat | Date: | Thu, 30 May 2002 01:38:24 +0000 |
| Subject: | Re: [SMARTY] Smarty global variables | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4444@lists.php.net to get a copy of this message | ||
Have you investigated config files? This sound more like what you are
looking for, i.e. values that remain the same every time you call the
template but are not assigned in the php script. The same config file can
also be shared by multiple templates.
http://www.phpinsider.com/php/code/Smarty/docs/language.config.variables.htm
l
http://www.phpinsider.com/php/code/Smarty/docs/language.function.config.load
.html
Hope that helps.
Jason
----- Original Message -----
From: "Blue Presley" <blue928@carolina.rr.com>
To: <smarty-general@lists.php.net>
Sent: Wednesday, May 29, 2002 8:34 PM
Subject: [SMARTY] Smarty global variables
I'm using code identical to the following to assign variable values to
Smarty variables:
$smarty->assign("x","y");
My question is, Are all assigned template variables automatically added to
the $global_assign variable? I am wanting to access template variables
accross multiple templates w/o having to directly assign them in each of my
.php files.
If the variables are not automatically assigned to a global array, then how
do i add it to it?
Even more importantly, what is the correct format for accessing the global
template variables? Using the above as an example, I've tried:
{$global_assign.x}
but nothing is happening.. what am I doing wrong?
Thanks in advance,
Blue