亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

zend framework重定向方法小結

 更新時間:2016年05月28日 09:41:51   作者:鷹眼  
這篇文章主要介紹了zend framework重定向方法,總結歸納了常用的zend framework重定向方法,非常簡單易懂,需要的朋友可以參考下

本文總結了zend framework重定向的方法。分享給大家供大家參考,具體如下:

一. render

不指定render

結果: {當前Module}/{當前Controller}/{當前Action}.phtml

$this->render('bar');

結果: {當前Module}/{當前Controller}/bar.phtml

二. forward

$this->_forward('bar');

結果: {當前Module}/{當前Controller}/bar

$this->_forward('bar', 'foo');

結果: {當前Module}/foo/bar

$this->_forward('bar', 'foo', 'hoge');

結果: hoge/foo/bar

$params = array(
 'a' => '1',
 'b' => '2'
);
$this->_forward('bar', 'foo', 'hoge', $params);

結果: /hoge/foo/bar/a/1/b/2

三. redirect

$this->_redirect('/hoge');

結果: /hoge

$this->_redirect('/hoge/foo');

結果: /hoge/foo

$this->_redirect('/hoge/foo/bar');

結果: /hoge/foo/bar

$this->_redirect('http://localhost/hoge/foo/bar');

結果: http://localhost/hoge/foo/bar

$this->_redirect('http://localhost/hoge/foo/bar?a=1&b=2');

結果: http://localhost/hoge/foo/bar?a=1&b=2

四. 特殊情況

不使用 layout

結果:

$this->_helper->layout()->disableLayout();

不使用 view

結果:

$this->_helper->viewRenderer->setNoRender();

更多關于zend相關內容感興趣的讀者可查看本站專題:《Zend FrameWork框架入門教程》、《php優(yōu)秀開發(fā)框架總結》、《Yii框架入門及常用技巧總結》、《ThinkPHP入門教程》、《php面向對象程序設計入門教程》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總

希望本文所述對大家基于Zend Framework框架的PHP程序設計有所幫助。

相關文章

最新評論