Fabriq Framework Docs

Helper files contain functions that are used by controllers. Helper functions that are used by multiple controllers should be stored in the /app/helpers/application.helper.php file. Helper functions that are used by actions in only one controller should be stored in a helper file that has the same name as the controller (ex: /app/helpers/users.helper.php).

When mapping paths to include controller and action files, the framework will look for the existence of a helper file. If the helper file exists for the specified controller, it will be automatically included and its functions will be available.

Example of a function used in the application helper file (stored in the file /app/helpers/application.helper.php):

/**
 * Validate login function description
 */
function validateLogin() {
  // validateLogin contents
}

Example of a function used in a controller specific helper file (ex: /app/helpers/users.helper.php):

/**
 * Block user function description
 */ 
function blockUser() {
  // blockUser contents
}