yii頁面跳轉怎么傳值

yii頁面跳轉怎么傳值

YII中頁面跳轉與傳值:

1、在同一個Controller中頁面跳轉

$this->render('view頁面',array('參數'=>'值')); $this->render('news',array('result'=>'123','result1'=>'456'));

url重定向 ??

$this->redirect(array('action方法')); $this->redirect(array('getnews','id'=>1,,,,));

2、在不同的Controller中頁面跳轉

$this->redirect(array('跳轉到的controller/跳轉到的controller里的action','參數'=>'值',,,,)); $this->redirect(array('user/getuser','id'=>1));

php中文網,有大量免費的Yii入門教程,歡迎大家學習!

? 版權聲明
THE END
喜歡就支持一下吧
點贊8 分享