Re: How to use a Smarty variable outside the template file ?

From: Date: Mon, 23 Jul 2001 18:54:07 +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-1255@lists.php.net to get a copy of this message
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");


« previous php.smarty.general (#1255) next »