YII2 development of reference

A parameter acquisition

use Yii;
Yii::$app->params['params'];

Two settings page title

$this->getView()->title = "page title";

Three controller-related

 3.1 Get the current controller
$controllerID = Yii::$app->controller->id;
  3.2 Get the current action
$actionID = Yii::$app->controller->action->id;

Guess you like

Origin www.cnblogs.com/shanhuhai/p/12085365.html