controller\hello <?php namespace app\controllers; use yii\web\Controller; class helloController extends Controller { public function actionIndex(){ return $this->renderPartial("index"); } } ?> view\hello\about.php hello about! <?=$v_hello_str;?> view\hello\index.php hello index! <?php echo $this->render("about",array("v_hello_str"=>"hello world!"));?><!--视图组件 $this -->