Flow of Control

General Principles

It is important to understand that Hardhat Framework is set up to process three distinct types of transactions.

  • GET Transactions
    • Known as Navigation Actions in the framework
    • Result in a template being displayed
  • POST Transactions
    • Known as Post Actions in the framework
    • Usually the result of a form submission
    • Update something in the system
    • Result in a get transaction being issued via a redirect
    • The redirect prevents the Post from being reissued when the back button or refresh button is pressed.
  • AJAX Transactions
    • Known as Ajax Actions in the framework
    • Could be either Get or Post
    • Are identified by ajax as the first node in the url

IMPORTANT! In case you missed it, when a Post transaction is executed it finishes by issuing a redirect to a Get tranaction. The cool thing about that is that it ensures that a Post transaction is never accidently reissued when the user presses the back button or refresh button.

Basic Flow

See the following pages for a detailed explanation of each tranasction type, but the basic flow goes like this. First, the index.php module is invoked via .htaccess redirects.

The index.php module will locate the components (application, framework, and configuration), and then call the classloader, which sets up the autoload procedure to load classes when they are referenced. It is important that classes be named properly, and reside in the appropriate place for this to work.