Set Gohome()

Hi Everyone,

How can I set the default landing view for non-logged in users and a different one for logged in users?

So when users go to //localhost/ they go to a default landing page, then when they login they go to a logged in landing page.

Many Thanks in Advance


if (Yii::$app->user->isGuest) {

  return $this->render('guest');

} else {

  return $this->render('loggedin');


Thanks, I assume this will go within the default Index action of the site controller?

yes :)