Alireza
Alireza

Reputation: 5673

how to find out that the user is logged in

I need a module to be shown like this:

if (the user is logged in){
    \\ module should be this html(1)
}else{
    \\ module should be like this html(2)
}

is this possible? should I add sth in the template index.php?

Upvotes: 0

Views: 149

Answers (1)

Gaurav
Gaurav

Reputation: 28755

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

Upvotes: 3

Related Questions