Re: [SMARTY] Passing args. by reference
| From: | Wom.bat | Date: | Wed, 07 May 2003 14:51:14 +0000 |
| Subject: | Re: [SMARTY] Passing args. by reference | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9493@lists.php.net to get a copy of this message | ||
Smarty uses $GLOBALS["HTTP_GET_VARS"] etc...
I am using $_R/G/P/C-Vars, too, so I had to assign $_REQUEST or $_POST etc
manually.
IIRC, Smarty assigned the vars internally when creating a new instance, so
you cannot even change the $GLOBALS... vars, as they remain unchanged in
Smarty, but as I said, I don't remember exactly
Regards
David
----- Original Message -----
From: "Nino Katic" <nkatic@public.srce.hr>
To: "smarty" <smarty-general@lists.php.net>
Sent: Wednesday, May 07, 2003 1:15 PM
Subject: [SMARTY] Passing args. by reference
> Hi,
>
> I have something like this:
>
> $_POST['name'] = 'John' // from HTML form
>
> $test->foo($_POST['name']);
>
> class test
> {
> function foo(&$somevar)
> {
> $somevar = 'somethnig';
> }
> }
>
> and in tpl:
>
> {$smarty.post.name}
>
> prints 'John' but if do assign of $_POST['name'] to some var and print
> that var in tpl i get 'something'. Now, the question is why doesn't it
> print out 'something' the first time?
>
> Nino
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>