Zend Framework Zend Framework processes an HTTP request process analysis

Source: Internet
Author: User
Tags zend framework

1, the first is the bootstrap process, the resources used in the initialization program

2, create a Zend_controller_front entity that implements the front controller pattern, which is responsible for dispatching the HTTP request to the appropriate controller's action.

3, Front Controller creates two objects to encapsulate HTTP requests and HTTP replies, respectively, Zend_controller_request_http and Zend_controller_response_http

4, Front controller will create two objects to implement URL pathfinding and dispatch, respectively, routing and dispatcher, respectively, is responsible for finding the specified URL should be executed by the Controller and action, and load the corresponding program file and execute the corresponding method.

5, through the controller's plugin mechanism, Zend_controller_action_viewrenderer will create a view property for the controller's entity class, which is a Zend_view entity object. It is also responsible for rendering the corresponding template file render to the HTTP response object after the controller action request processing is complete. The contents of the last response object are output by the front controller to the browser.

6, in the fifth step, although the template file is located by the Viewrender helper object, but is performed by a member function of Zend_view (include into the template file), So all the properties and member functions of the View object in the controller can be used in the template file.

The lifetime of such an HTTP request is over, and the browser gets the content. When the Controller's action gives the view a variable to render, it typically interacts with the database through zend_db_table to get the data.

Interacting with the database data is called business logic, and the template file also includes logic such as simple loops, which is called display logic.

In the MVC implementation, the model handles business logic, the view handles display logic, and the controller coordinates the two parts so that the controller's code should be as concise as possible, just as an agent exists.

The above describes the process analysis of an HTTP request processed by the Zend framework Zend framework, including the contents of the Zend framework, and hopefully helps friends interested in PHP tutorials.

  • Related Article

    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.