Zend Framework Redirection Method Summary, zendframework_php tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.