Re: [SMARTY] vars from templates structure
| From: | Monte Ohrt | Date: | Thu, 21 Nov 2002 17:45:40 +0000 |
| Subject: | Re: [SMARTY] vars from templates structure | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6495@lists.php.net to get a copy of this message | ||
I'm not sure why you'd want to do that, explain why? But a prefilter
might do the job for you. regex out all the variables, assign them
according to name, then continue.
On Thu, 2002-11-21 at 11:34, Juri Smarschevski wrote:
> hi list,
>
> there is a sample templates structure:
>
> [aaa.tpl]
> <HTML>
> <TITLE>Hello</TITLE>
> <BODY>
> Hello from aaa, {$A}!<br>
> {include file="bbb.tpl"}
> </BODY>
> </HTML>
>
> [bbb.tpl]
> Hello from bbb, {$B}!
>
>
> [php-file]
> /*
> detect all tpl vars beginning from aaa.tpl
> do dynamically assign (value to var)
> */
> $smarty->display("aaa.tpl");
>
> Is't possible in the php-file to detect all templates variables
> (inclusive included templates)? That means I get an array or
> something similar which in this case includes strings "A" and "B".
>
> The function "get_template_vars" analyses assigns in the php files,
> note in templates. I need it "reversed" ;-).
>
>
> thx in advance and kind regards,
> juri
>
>
--
Monte Ohrt <monte@ispi.net>