Re: [SMARTY] assign_by_ref better than assign?
| From: | atu | Date: | Sun, 10 Aug 2003 08:19:39 +0000 |
| Subject: | Re: [SMARTY] assign_by_ref better than assign? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10028@lists.php.net to get a copy of this message | ||
Hi.
This could be a pitfall. But not tested.
Template variables num1 and num2 point to the same php variable. If num1 is
modified in a template, num2 is also modified.
$phpvar = 5;
$smarty->assign_by_ref("num1", $phpvar);
$smarty->assign_by_ref("num2", $phpvar);
{math equation="x + y" x="1" y="1" assign="num1"}
{$num1} {$num2}
It's to be tested.
Armand
----- Original Message -----
From: "John W. Holmes" <holmes072000@charter.net>
To: <smarty-general@lists.php.net>
Sent: Sunday, August 10, 2003 6:41 AM
Subject: [SMARTY] assign_by_ref better than assign?
> Hi. I just noticed the assign_by_ref() method. I usually build up a
> large $input array that's passed to smarty to display everything with
> {$input.key}. Am I correct in assuming that things will be faster and
> less memory intensive by using assign_by_ref() instead of assign()? Are
> there any pitfalls I should be watching for by using assign_by_ref()?
>
> Thanks.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>