不带参数跳转到views/index.php
return $this ->renderPartial( 'index.php');
带参数跳转到 views/index.php
$hello ='hello world!';
return $this -> renderPartial( 'index.php' ,['hello'=> $hello] );
带参数跳转到 views/index.php,参数是数组
$hello =array( 1,2);
return $this -> renderPartial( 'index.php' ,['hello'=> $hello] );
将视图替换 $content变量放到layout文件中然后跳转到 views/index.php
public $layout ='Common';
return $this ->render( 'index');
在视图中加载另外一个视图
<?=$this ->render( 'about',['hello' =>$hello]) ?>
不带参数跳转到另一个action
return $this -> redirect('index' );
带参数跳转到另一个action
return $this ->redirect([ 'index','tag' =>1]);