Renderforwardredirect Difference redirect Forward difference pay it forward put Forwar

Source: Internet
Author: User
Render

1. Do not specify render

Result: (current models is within Controller)/(current Controller)/(current action). phtml

2. $this->render (' xxx ');

Result: (current models is within Controller)/(current controller)/xxx.phtml

3. Summary

Render directly into the view file

Forward

1. $this->forward (' xxx ');

Result: (current models is within Controller)/(current controller)/xxxaction

2. $this->forward (' xxx ', ' Yyy ');

Result: (current models is controller)/yyycontroller/xxxaction

3. $this->forward (' xxx ', ' Yyy ', ' zzz ');

Results: Zzz/yyy/xxxaction

4. t h I s ? f o r w a R d ( , x x x * , - Y Y y - , * Z Z z - , params); Multilayer

$params = Array (
' A ' = ' 1 ',
' B ' = ' 2 '
);
Results:/ZZZ/YYY/XXX/A/1/B/2

5. Summary

By forward can jump to this controller that a function
can also jump to other controller a function

redirect

1. $this->redirect ('/xxx ');

Results:/xxx

2. $this->redirect ('/xxx/yyy ');

Results:/xxx/yyy

3. $this->redirect ('/xxx/yyy/zzz ');

Results:/xxx/yyy/zzz

4. $this->redirect (' http://www.baidu.com ');

Result: Jump to Baidu outside the network

5. Summary

Redirect can be turned to this website or extranet

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the render\forward\redirect differences, including the forward,render aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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