1.yii-application/frontend/controller/siteController.php
在最后添加
public function actionSay($message='hello'){
return $this->render('say',['message'=>$message]);
}
2.yii-application/frontend/views/site/say.php
<?php
use yii/helpers/Html;
?>
<?=Html::encode($message)?>
3.测试:url:y2aa-frontend.test/index.php?r=site/say&message=Hello+World
显示:Hello World