Re: Getting value of {assign} variable
| From: | Andrei Zmievski | Date: | Tue, 18 Dec 2001 15:32:03 +0000 |
| Subject: | Re: Getting value of {assign} variable | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2326@lists.php.net to get a copy of this message | ||
On Mon, 17 Dec 2001, Peter Bowyer wrote:
> Is there any way I can find what value has been assigned to a variable from
> within my script? For instance the designer may have put the following in
> a template:
> {assign var='design' value='popup'}
> which means that the page is to be displayed without the usual junk around
> it (in a popup window). Now obviously in my script I need to find out if
> the designer has set this value, and if so, what to. I can then put the
> correct layout around the template's content as required...
You can find this out only if you first display() or fetch() the
template. Then you can use get_template_vars() to retrieve the template
array which will contain the assigned variable.
-Andrei
* "I'll need daily status reports on why you're so behind." -- Dilbert's
boss *