Tuesday, November 1, 2011

Typical Workflow of a Yii Application

Before we go any further, let us know how to work the first Yii application when handling a user request.

Here is a typical workflow of a series of Yii application when handling user requests.
  1. User makes a request to the URL http://www.yiicode.com/index.php?r=post/show&id=1 and Web server handles the request by running the bootstrap script index.php.
  2. Bootstrap script creates an instance application and run it.
  3. Applications to get detailed information from the user requests an application component named request.
  4. The application determines the requested controller and action with the help of an application component named urlManager. In this example, the controller is a post that refers to class PostController; and actions show the true meaning is determined by the controller.
  5. Application creates an instance controller is required to further handle user requests. Show the controller determines that the action refers to a method named actionShow the controller class. Then create and run a filter (eg access control, measurement) associated with this action. The action is executed if allowed by the filter.
  6. Action to read the Post Model where the ID is 1 from the database.
  7. Action renders a view named show with the model of the Post.
  8. View to read and display the attributes of the Post model.
  9. View running multiple widgets.

No comments:

Post a Comment

Yii Framework Tutorials