Re: [SMARTY-DEV] $smarty.session.object doesn't work in 2.5.0
| From: | messju mohr | Date: | Tue, 15 Apr 2003 15:28:58 +0000 |
| Subject: | Re: [SMARTY-DEV] $smarty.session.object doesn't work in 2.5.0 | ||
| References: | 1 | Groups: | php.smarty.dev php.smarty.general |
| Request: | Send a blank email to php-smarty-dev+get-1160@lists.php.net to get a copy of this message | ||
On Tue, Apr 15, 2003 at 04:55:59PM +0200, Wom.bat wrote:
> Hi folks, I just updated to 2.5.0
> I have an object "user" registered in my session, and until 2.5.0,
> I was able to access it via $smarty.session.user->property
> Now I am getting the error:
>
> Fatal error: Smarty: [in index.tpl line 66]: syntax error:
> $smarty.session.user is an invalid reference (Smarty_Compiler.class.php,
> line 1693) in e:\htdocs\clancms\core\Smarty_Compiler.class.php on line 1824
>
> Anybody got an idea why this doesn't work anymore?
yep. the problem lies in how $smarty...-refs are compiled now. you
have to workaround it in the moment:
in php:
$smarty->assign_by_ref('session', $_SESSION);
and then in $tpl:
{$session.user->property}
greetings
messju
> Regards,
> David
>
>
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php