Post Request Flow

post request flow

index.php

All transactions initially execute index.php as a result of redirection which occurs in the .htaccess file. This is where you would specify where the framework and application reside.

It calls the bootstrap.php module in the application and then calls the frontController, or AjaxController based on the url.

ajax in the first node means it will be treated as an ajax transaction.

bootstrap.php

This module resides in the application and does some initialization. You may add application specific logic to this module if you like.

sys_front_controller.php

This module resides in the framework and processes Get or Post transctions. It calls the sys_request class to parse the url, and look up the command in the commands.xml file. The important thing to note here is that commands.xml, which resides in the configuration directory maps urls to action classes. The front controller then calls the action class, which in the case of a post is known in the framework as a post action.

post action

The post action resides in the /modules/[module_name]/controllers/post_action directory of the application with a name like [module]_post_[descriptive_name].php and has a class of that name inside.

The job of the Post Action is to perform whatever update needs to be done in the system, and then to redirect to the appropriate get/navigation action.