In layouts/main.php, I acknowledge that we can have a different view when we visit as a guest or signed in user by using a ternary operator like this
Yii::$app->user->isGuest ?
['label' => 'Sign In', 'url' => ['/site/login']]:
['label' => 'Sign Out', 'url' => ['/site/logout']];
However, what I want now is to hide a menu from a guest. I try with the following code but failed.
Yii::$app->user->isGuest ? []:
['label' => 'Courses', 'url' => ['/site/courselist']];
What code construction should I have instead?