Re: [SMARTY] two problems translated
| From: | Andrei Zmievski | Date: | Fri, 19 Apr 2002 14:38:16 +0000 |
| Subject: | Re: [SMARTY] two problems translated | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3815@lists.php.net to get a copy of this message | ||
On Fri, 19 Apr 2002, Gabor Hojtsy wrote:
> You have a template (test.tpl):
>
> <html>
> <head>
> <title>{$title_var}
> </head>
> <body>
> {$somevar}
> </body>
> </html>
>
> You have a PHP code:
>
> $smarty->assign("title_var", "Title");
>
> At this point {$somevar} is not defined in the template.
> You can use this to test that you have already set all the
> needed vars, or you can use this to call up custom functions
> in your own code, depending on the vars in the template.
>
> BTW we have a get_template_vars() for getting already defined
> vars. We have no function to get undefined vars...
That's because Smarty doesn't know what variables the template has until
you call display() or fetch(). That's when compilation happens.
-Andrei
* 2 + 2 = 5 for extremely large values of 2. *