Yii2 Lesson - 02 Routing in Yii2

controller模块和view模块的展示,输出view界面 附带参数


controllers/SiteContrller.php

function actionHello(){
	$name = 'Json';
   return $this->render('hello',['name'=>$name]);
}

views/hello.php

<?= $name ?>

posted @ 2017-06-13 13:42  Json_zzz  阅读(98)  评论(1)    收藏  举报