Passing args. by reference
| From: | Nino Katic | Date: | Wed, 07 May 2003 11:15:40 +0000 |
| Subject: | Passing args. by reference | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9492@lists.php.net to get a copy of this message | ||
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