Development - Workflow
General ¶The following diagram shows the static structure of a ApPHP Framework application:
Typical Workflow ¶This diagram shows a typical workflow of a ApPHP Framework application when it handls a user request:
- Site visitor makes a request with the URL, ex.: http://www.yourdomain.com/index.php?url=pages/view&id=1 and the Web server handles the request by executing the bootstrap script index.php.
The bootstrap script creates an Application instance and runs it:
<?php ... A::init($config)->run();
The application receives a user request information from the framework component named
The application determines the requested controller and action. For this example, the controller
pages, which refers to the
PagesControllerclass; and the action is
view, whose actual meaning is determined by the controller.
The application creates an instance of the requested controller to handle the user request.
The controller determines that the action show refers to a method named
viewActionin the controller class.
- The action reads a Pages model record whose ID is 1 from the database.
The action renders a view named
viewwith the Pages model.
- The view reads and displays the variables passed from controller.
- The view may execute widgets.
- The action completes the view rendering and displays the result to the user using defined templates or layouts.