如何找出用户已登录

时间:2011-03-07 15:16:28

标签: joomla

我需要一个模块显示如下:

if (the user is logged in){
    \\ module should be this html(1)
}else{
    \\ module should be like this html(2)
}
这可能吗? 我应该在模板index.php?

中添加sth

1 个答案:

答案 0 :(得分:2)

$user = JFactory::getUser();
if ($user->id){
    \\ module should be this html(1)
}else{
    \\ module should be like this html(2)
}