The way to reference the default controller and the default action on that controller has changed. Essentially the defaultController in Yii might not be a controller, so it is now referred to as a route (i.e. defaultRoute) and the default Action on a controller in Yii2 is the name of the action rather than the Action object.
Yii
$controller = Yii::app()->getController();
$default_controller = Yii::app()->defaultController;
$isHome = (($controller->id === $default_controller->id) && ($controller->action->id === $controller->defaultAction->id)) ? true : false;
Yii 2
$controller = Yii::$app->controller;
$default_controller = Yii::$app->defaultRoute;
$isHome = (($controller->id === $default_controller) && ($controller->action->id === $controller->defaultAction)) ? true : false;
Reference: http://stackoverflow.com/questions/12341791/yii-check-if-homepage