zend framework重定向方法小结

前端之家收集整理的这篇文章主要介绍了zend framework重定向方法小结前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

一. render

不指定render

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

403_10@render('bar');

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

二. forward

403_10@_forward('bar');

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

403_10@_forward('bar','foo');

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

403_10@_forward('bar','foo','hoge');

结果: hoge/foo/bar

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

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

三. redirect

403_10@_redirect('/hoge');

结果: /hoge

403_10@_redirect('/hoge/foo');

结果: /hoge/foo

403_10@_redirect('/hoge/foo/bar');

结果: /hoge/foo/bar

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

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

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

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

四. 特殊情况

不使用 layout

结果:

403_10@_helper->layout()->disableLayout();

不使用 view

结果:

403_10@_helper->viewRenderer->setNoRender();

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

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

猜你在找的PHP相关文章