Folder Structure

A Haplo Framework install contains the following directories:

Processing Steps

When a request is made to an application written using the Haplo Framework the following steps take place:

  1. The "index.php" file is run.
  2. It runs a simple set up check that reports any problems with the installation. This is pretty lightweight but can be disabled if required.
  3. Next Haplo Framework files are included and an instance of the config object is created which processes any configuration files stored in the "config" directory (files must end with .ini).
  4. An instance of HaploRouter is then created which tries to match the request URI against an array containing URL pattern to action mappings. As soon as it finds a match it returns the appropriate action name.
  5. "index.php" then includes the corresponding action file.
  6. Action files can contain straight PHP or a class which extends HaploAction. HaploAction provides a number of helper methods for running code depending on the request method (GET, POST etc) as well as providing hooks for form validation success and failure.
  7. If a class that extends HaploAction is found, "index.php" will create an instance.
  8. Action files should contain code for retrieving data from models and combining with templates to create finished pages. They should also contain any validation code required by your application.
  9. Whilst rendering templates any custom template functions referenced will be run.
  10. The HaploTemplate class provides methods for specifying post filter functions. These can modify the generated template output.

» Back to index