Yii check if homepage
Is there a buildin method or property in Yii to check if page is homepage? I know i can use something like this: $controller = Yii::app()->getController(); $isHome = $controller->getAction()->getId() === 'index' ? true : false; Or put it in a method in main controller, but i am looking for something cleaner. Thanks. Rajat Singhal If You want to check the current page, ie action is the default of the current controller.. $controller = Yii::app()->getController(); $isHome = $controller->action->id === $controller->defaultAction->id ? true : false; dafeultaction may not always be 'index', it can