01-11-2017, 12:27 AM
You're exactly right.
is the way to go. There are other ways to detect if the user variable is set or something like that, but isLoggedIn is the official and most reliable way to do it.
Code:
if($user->isLoggedIn()){ }
is the way to go. There are other ways to detect if the user variable is set or something like that, but isLoggedIn is the official and most reliable way to do it.