zend framework重定向方法小结

本文总结了zend framework重定向方法分享给大家供大家参考,具体如下:

一. render

不指定render

结果: {当前Module}/{当前Controller}/{当前Action}.phtml

render('bar');

结果: {当前Module}/{当前Controller}/bar.phtml

二. forward

_forward('bar');

结果: {当前Module}/{当前Controller}/bar

_forward('bar','foo');

结果: {当前Module}/foo/bar

_forward('bar','foo','hoge');

结果: hoge/foo/bar

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

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

三. redirect

_redirect('/hoge');

结果: /hoge

_redirect('/hoge/foo');

结果: /hoge/foo

_redirect('/hoge/foo/bar');

结果: /hoge/foo/bar

_redirect('http://localhost/hoge/foo/bar');

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

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

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

四. 特殊情况

不使用 layout

结果:

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

不使用 view

结果:

_helper->vieWrenderer->setnorender();

更多关于zend相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》、《》、《》及《PHP常见数据库操作技巧汇总》

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

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...