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程序設計有所幫助。
- Zend Framework框架的校驗器InArray使用示例
- Zend?Framework框架的校驗器使用使用示例(自定義校驗器和校驗器鏈)
- Zend Framework入門教程之Zend_Session會話操作詳解
- Zend Framework入門教程之Zend_Mail用法示例
- Zend Framework入門教程之Zend_Db數(shù)據(jù)庫操作詳解
- ZendFramework框架實現(xiàn)連接兩個或多個數(shù)據(jù)庫的方法
- Zend Framework框架實現(xiàn)類似Google搜索分頁效果
- Zend Framework上傳文件重命名的實現(xiàn)方法
- php入門教程之Zend Studio設置與開發(fā)實例
- Zend Framework開發(fā)入門經(jīng)典教程
- Zend Framework常用校驗器詳解
相關文章
Laravel5.5 數(shù)據(jù)庫遷移:創(chuàng)建表與修改表示例
今天小編就為大家分享一篇Laravel5.5 數(shù)據(jù)庫遷移:創(chuàng)建表與修改表示例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-10-10使用ThinkPHP+Uploadify實現(xiàn)圖片上傳功能
這篇文章主要介紹了使用ThinkPHP+Uploadify實現(xiàn)圖片上傳功能,需要的朋友可以參考下2014-06-06PHP基于SMTP協(xié)議實現(xiàn)郵件發(fā)送實例代碼
本篇文章主要介紹了PHP基于SMTP協(xié)議實現(xiàn)郵件發(fā)送實例代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04SSO單點登錄的PHP實現(xiàn)方法(Laravel框架)
這篇文章主要介紹了SSO單點登錄的PHP實現(xiàn)方法(Laravel框架) 的相關資料,需要的朋友可以參考下2016-03-03