Zend Framework Redirection method Summary, Zendframework
This paper summarizes the methods of Zend Framework redirection. Share to everyone for your reference, 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 ' = ' 1 ', ' b ' = ' 2 '); $this->_forward (' Bar ', ' foo ', ' Hoge ', $params);
Results:/HOGE/FOO/BAR/A/1/B/2
Three. redirect
$this->_redirect ('/hoge ');
Results:/hoge
$this->_redirect ('/hoge/foo ');
Results:/hoge/foo
$this->_redirect ('/hoge/foo/bar ');
Results:/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 ();
More interested in Zend related content readers can view the topic: "Zend framework of the introductory tutorial", "PHP Excellent Development Framework Summary", "Yii framework Introduction and common skills Summary", "thinkphp Introductory Tutorial", "PHP object-oriented Programming introduction tutorial "," Introduction to Php+mysql Database Operation "and" PHP common database Operation Skills Summary "
It is hoped that this article will help you to design PHP based on the Zend Framework framework.
http://www.bkjia.com/PHPjc/1133059.html www.bkjia.com true http://www.bkjia.com/PHPjc/1133059.html techarticle Zend Framework Redirection Method Summary, zendframework This article summarizes the Zend Framework redirection method. Share to everyone for your reference, as follows: I. Render does not specify a render knot ...