Re: [SMARTY] globals
| From: | Wom.bat | Date: | Tue, 29 Jul 2003 21:56:47 +0000 |
| Subject: | Re: [SMARTY] globals | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9988@lists.php.net to get a copy of this message | ||
smarty 2.5.0 uses $GLOBALS["HTTP_POST_VARS"] and the other old arrays
instead of the new superglobals ($_GET, $_POST etc)... either use the latest
cvs version where you can choose between the two or use the other variables
to save you time, you can just do
$GLOBALS["HTTP_GET_VARS"] =& $_GET;
$GLOBALS["HTTP_POST_VARS"] =& $_POST;
at the beginning of your scripts
that will create references to the superglobals and thus affect changes on
both variables
David
On Tuesday, July 29, 2003 11:50 PM +0200, Olivier Doucet [reagi.com] wrote:
> Hi , I have some troubles with globals & smarty.
> Here is an example, it will be easier to understand :
>
> In php :
> [ smarty initialisation ]
> $myvar = "prenom";
> $_POST['nv_'.$myvar] = 'myvalue';
>
> [ smarty display]
>
> ---------
> in Tpl :
> --> {$smarty.post.nv_prenom} <--<br>
>
> --------
> but it echoed nothing :(((
>
> I've done a var_dump directly in php, and my var IS in _POST :
> array(1) { ["nv_prenom"] => string("7") "myvalue" }
>
>
> Any idea ???
>
> Olivier Doucet