Get the App
SLTechnology News&Howtos  ›  Development  › 

How to achieve redirection in zend framework

Shulou Source: shulou.com Published: 2022-06-03 19:52:20 11月12日 Update

Editor to share with you how to achieve zend framework redirection, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The details are as follows:

one。 Render

Do not specify render

Result: {current Module} / {current Controller} / {current Action} .phtml

$this- > render ('bar')

Result: {current Module} / {current Controller} / bar.phtml

two。 Forward

$this- > _ forward ('bar')

Result: {current Module} / {current Controller} / bar

$this- > _ forward ('bar',' foo')

Result: {current Module} / foo/bar

$this- > _ forward ('bar',' foo', 'hoge')

Results: hoge/foo/bar

$params = array ('a'= > '1century,' b' = >'2'); $this- > _ forward ('bar',' foo', 'hoge', $params)

Result: / hoge/foo/bar/a/1/b/2

three。 Redirect

$this- > _ redirect ('/ hoge')

Result: / hoge

$this- > _ redirect ('/ hoge/foo')

Result: / hoge/foo

$this- > _ redirect ('/ hoge/foo/bar')

Result: / hoge/foo/bar

$this- > _ redirect ('http://localhost/hoge/foo/bar');

Results: http://localhost/hoge/foo/bar

$this- > _ redirect ('http://localhost/hoge/foo/bar?a=1&b=2');

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

four。 Special circumstances

Do not use layout

Results:

$this- > _ helper- > layout ()-> disableLayout ()

Do not use view

Results:

$this- > _ helper- > viewRenderer- > setNoRender (); that's all of the article "how to redirect zend framework". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Results articles content special not so much most situation more knowledge industry information information channels channels reference learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Technology Linux Shulou Information vpn