Hi,
How to have data member in template ?
This code with Contao 3.3.6 not working
Code:if (FE_USER_LOGGED_IN)
{
$this->import('FrontendUser', 'User');
echo $this->User->id;
}
Printable View
Hi,
How to have data member in template ?
This code with Contao 3.3.6 not working
Code:if (FE_USER_LOGGED_IN)
{
$this->import('FrontendUser', 'User');
echo $this->User->id;
}
I can not confirm this on C 3.3.7. Are you sure a member is logged in into FE?
You also can use the modern way
PHP Code:
echo \FrontendUser::getInstance()->id;
// or if you need more variables
$objMember = \FrontendUser::getInstance();
echo $objMember->id;