zend framework重定向方法小結(jié)
本文總結(jié)了zend framework重定向的方法。分享給大家供大家參考,具體如下:
一. render
不指定render
結(jié)果: {當(dāng)前Module}/{當(dāng)前Controller}/{當(dāng)前Action}.phtml
$this->render('bar');
結(jié)果: {當(dāng)前Module}/{當(dāng)前Controller}/bar.phtml
二. forward
$this->_forward('bar');
結(jié)果: {當(dāng)前Module}/{當(dāng)前Controller}/bar
$this->_forward('bar', 'foo');
結(jié)果: {當(dāng)前Module}/foo/bar
$this->_forward('bar', 'foo', 'hoge');
結(jié)果: hoge/foo/bar
$params = array( 'a' => '1', 'b' => '2' ); $this->_forward('bar', 'foo', 'hoge', $params);
結(jié)果: /hoge/foo/bar/a/1/b/2
三. redirect
$this->_redirect('/hoge');
結(jié)果: /hoge
$this->_redirect('/hoge/foo');
結(jié)果: /hoge/foo
$this->_redirect('/hoge/foo/bar');
結(jié)果: /hoge/foo/bar
$this->_redirect('http://localhost/hoge/foo/bar');
結(jié)果: http://localhost/hoge/foo/bar
$this->_redirect('http://localhost/hoge/foo/bar?a=1&b=2');
結(jié)果: http://localhost/hoge/foo/bar?a=1&b=2
四. 特殊情況
不使用 layout
結(jié)果:
$this->_helper->layout()->disableLayout();
不使用 view
結(jié)果:
$this->_helper->viewRenderer->setNoRender();
更多關(guān)于zend相關(guān)內(nèi)容感興趣的讀者可查看本站專(zhuān)題:《Zend FrameWork框架入門(mén)教程》、《php優(yōu)秀開(kāi)發(fā)框架總結(jié)》、《Yii框架入門(mén)及常用技巧總結(jié)》、《ThinkPHP入門(mén)教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門(mén)教程》、《php+mysql數(shù)據(jù)庫(kù)操作入門(mén)教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總》
希望本文所述對(duì)大家基于Zend Framework框架的PHP程序設(shè)計(jì)有所幫助。
- Zend Framework框架的校驗(yàn)器InArray使用示例
- Zend?Framework框架的校驗(yàn)器使用使用示例(自定義校驗(yàn)器和校驗(yàn)器鏈)
- Zend Framework入門(mén)教程之Zend_Session會(huì)話操作詳解
- Zend Framework入門(mén)教程之Zend_Mail用法示例
- Zend Framework入門(mén)教程之Zend_Db數(shù)據(jù)庫(kù)操作詳解
- ZendFramework框架實(shí)現(xiàn)連接兩個(gè)或多個(gè)數(shù)據(jù)庫(kù)的方法
- Zend Framework框架實(shí)現(xiàn)類(lèi)似Google搜索分頁(yè)效果
- Zend Framework上傳文件重命名的實(shí)現(xiàn)方法
- php入門(mén)教程之Zend Studio設(shè)置與開(kāi)發(fā)實(shí)例
- Zend Framework開(kāi)發(fā)入門(mén)經(jīng)典教程
- Zend Framework常用校驗(yàn)器詳解
相關(guān)文章
實(shí)例講解php數(shù)據(jù)訪問(wèn)
這篇文章主要以實(shí)例講解的方式為大家詳細(xì)介紹了php數(shù)據(jù)訪問(wèn),數(shù)據(jù)訪問(wèn)有兩種方式,本文為大家揭曉,感興趣的小伙伴們可以參考一下2016-05-05laravel郵件發(fā)送的實(shí)現(xiàn)代碼示例
這篇文章主要介紹了laravel郵件發(fā)送的實(shí)現(xiàn)代碼示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-01-01Laravel5.5 數(shù)據(jù)庫(kù)遷移:創(chuàng)建表與修改表示例
今天小編就為大家分享一篇Laravel5.5 數(shù)據(jù)庫(kù)遷移:創(chuàng)建表與修改表示例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-10-10php獲取新浪微博數(shù)據(jù)API實(shí)例
要獲取新浪微博的數(shù)據(jù),可以通過(guò)他們提供的API,地址:http://open.weibo.com/wiki/API文檔_V2,獲取數(shù)據(jù)的方法如下:2013-11-11使用ThinkPHP+Uploadify實(shí)現(xiàn)圖片上傳功能
這篇文章主要介紹了使用ThinkPHP+Uploadify實(shí)現(xiàn)圖片上傳功能,需要的朋友可以參考下2014-06-06PHP基于SMTP協(xié)議實(shí)現(xiàn)郵件發(fā)送實(shí)例代碼
本篇文章主要介紹了PHP基于SMTP協(xié)議實(shí)現(xiàn)郵件發(fā)送實(shí)例代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04CI框架學(xué)習(xí)筆記(二) -入口文件index.php
本文介紹的是CI框架的入口文件index.php的相關(guān)資料,需要的朋友可以參考下2014-10-10SSO單點(diǎn)登錄的PHP實(shí)現(xiàn)方法(Laravel框架)
這篇文章主要介紹了SSO單點(diǎn)登錄的PHP實(shí)現(xiàn)方法(Laravel框架) 的相關(guān)資料,需要的朋友可以參考下2016-03-03