Yii2 layout 由 controller 向layout中传递参数值
// controller public function actionIndex() { Yii::$app->view->params['model'] = "hello world"; return $this->render('index'); } //layout main.php $model = $this->params['model']; 获取 hello world
// controller public function actionIndex() { Yii::$app->view->params['model'] = "hello world"; return $this->render('index'); } //layout main.php $model = $this->params['model']; 获取 hello world