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));
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END