Here is another way to present the last three lines of code. The ternary operator ? checks the user login status.
Code:
$user = $app->getSession()->get('user');echo ($user->id) ? $user->id : 'not logged in';
Statistics: Posted by toivo — Mon Jan 08, 2024 9:17 am