public function actionIndex()
{
$h2 = '这是一个主标题!';
$h5 = '这是一个副标题';
$dateTime = new \DateTime();
return $this->render('index', ['title' => $h2, 'subTitle' => $h5,'dateTime'=>$dateTime]);
}public function actionIndex()
{
//设置当前view的params参数,
$view = Yii::$app->view;
$view->params['layoutData']='test';
return $this->render('index');
}title = 'Login'; ?>= Html::encode($this->title); ?>
= $subTitle ?>= $dateTime->format('Y-m-d H:i:s'); ?>

方式二截图略,但确实调试通过。
上一篇:安装 Laravel 框架