Re: How to use a Smarty variable outside the template file ?
| From: | Monte Ohrt | Date: | Mon, 23 Jul 2001 18:55:49 +0000 |
| Subject: | Re: How to use a Smarty variable outside the template file ? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1256@lists.php.net to get a copy of this message | ||
How was it destroyed exactly? Are there curly braces that might affect
how Smarty parses the file? Can you attach before/after files to
compare?
Luc Saint-Elie wrote:
>
> Hello,
>
> (yeah I know.. its still me..)
>
> $smarty->fetch("myXMLfile"); send back a destroyed XML file, the tags are
> gone and so are the oppenning <[CDATA[..
>
> I tried with a simple
> $smarty->fetch() followed by a echo... its rather clear...
>
> Luc
>
> At 13:21 23/07/01 -0500, you wrote:
> >Your best bet is to have Smarty parse the XML file, then run that
> >through your xml parser. One way or another, you will need the data
> >parsed by your xml parser and by Smarty.
> >
> >// assign vars to smarty here
> >
> >// parse xml file through smarty
> >$xml_data = $smarty->fetch("cachecache.xml");
> >
> >// parse the xml data into arrays
> >xml_parse($xml_data);
> >
> >// assign your xml arrays to smarty here
> >
> >// display your template
> >$smarty->display("index.tpl");
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/