Smarty session update

30 views
Skip to first unread message

Abalam

unread,
Jun 24, 2009, 11:31:16 AM6/24/09
to Smarty Developers
Hi,

Correct me if i'm wrong (and i hope i am), but the session assignment
to $smarty.session seemes to be done as soon as the Smarty object is
created.

Is there a way to update the $smarty.session, if we update the real
$_SESSION before to call a fetch or display on the smarty object ?

Why $smarty.session is not assigned by reference ?

Is this method can be used to have a smarty variable by reference ?
$smarty->assign("reference_object",&$reference_object);

Thanks for reading,
Yann

U.Tews

unread,
Jun 24, 2009, 11:46:48 AM6/24/09
to Smarty Developers
Yann

This behavour was introduced with Smarty version 2.6.23 but is changed
back with version 2.6.26. (see www.smarty.net).

Smarty 3 does access the current version of $_SESSION when
$smarty.session is accessed in the template.

Uwe

Yann GAUTHERON

unread,
Jun 24, 2009, 11:59:49 AM6/24/09
to smarty-d...@googlegroups.com
Ok, thank you for you answer.

I am currently using an alias, basically assigned, with a '$__s' in my
templates to access the session.
In smarty 3, there is no more interest to do that, except that it is
smaller than '$smarty.session' to write.

Do you plan to let users able to change the keyvars $smarty.session
changed by something smaller ?
I ask that because in my mind, it reduces a lot the total weight of
templates, and coding time.
It's not very important.

Thanks a lot !
Yann

U.Tews a écrit :

Reply all
Reply to author
Forward
0 new messages