> php教程 > php手册 > 본문

zend framework重定向方法小结,zendframework

WBOY
풀어 주다: 2016-06-13 08:38:17
원래의
774명이 탐색했습니다.

zend framework重定向方法小结,zendframework

本文总结了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优秀开发框架总结》、《Yii框架入门及常用技巧总结》、《ThinkPHP入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

希望本文所述对大家基于Zend Framework框架的PHP程序设计有所帮助。

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!