Set Title In Controller

How can I set the page title in a controller actions?



In Your controller

$this->pageTitle = "Your titlel";

I thought the same, but I get this error message:

Setting unknown property: frontend\controllers\SiteController::pageTitle

LG Florian

PageTitle was in Yii 1.1… in 2.0 there is the property title of the view object -$title-detail

Yii::$app->view->title = ‘x’;