How to use a Smarty variable in an external source ?
| From: | Luc Saint-Elie | Date: | Sun, 22 Jul 2001 11:46:46 +0000 |
| Subject: | How to use a Smarty variable in an external source ? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1236@lists.php.net to get a copy of this message | ||
Hello,
I know the title is strange.
If I do in my .php file $tpl->assign('variable', $myvariable); I can do in my template {$variable} and the value of $myvariable is displayed in the resulting HTML file.. OK
But if I have an external file (in my case its a XML file but I suppose the same question would apply to a piece of text stored in mySQL) that contains {$variable}, then I process this file to inject it in the template.. how to have Smarty process {$variable}
In my case I have in the XML file
....[some XML]....
<![CDATA[......{$variable}.....]]>
....[some XML]....
This XML is then processed through a XML parser (phpxml) to output arrays, these arrays been send to a Smarty template.
In the resulting HTML file I have the string " {$variable}" and not the value of $myvariable displayed.
Ho could I do that ?
Thanks in advance a excellent week end to every one
Luc