I need to access value of $_SESSION['a']['b'] variable using smarty, In other words how can I rewrite this php code in smarty:
if ($_SESSION['a']['b']==1)
{
do task #1
}
elseif ($_SESSION['a']['b']==2)
{
do task #2
}
Any suggestions?
I need to access value of $_SESSION['a']['b'] variable using smarty, In other words how can I rewrite this php code in smarty:
if ($_SESSION['a']['b']==1)
{
do task #1
}
elseif ($_SESSION['a']['b']==2)
{
do task #2
}
Any suggestions?
See Accessing a variable (local or global) of PHP file from smarty:
The request variables such as
$_GET
,$_POST
,$_COOKIE
,$_SERVER
,$_ENV
and$_SESSION
are available via the$smarty
object.
Grab something from $_SESSION
:
{$smarty.session.MY_SESSION_VALUE} //Everything in $_SESSION is available.
Please check this above, you can directly call session in smarty.