The Subrion CMS script is designed to make extensions (plugins/packages) able to catch several actions by installing own hooks.
Hooks are described in the install.xml ( file of a particular extension.

The script writes the hooks to the DB when installing an extension.

The extension's control code can also contain hooks execution.
It could be done by calling the startHook method of the iaCore class. The function expects only 2 arguments:
  • (string) a name of hooks to call
  • (array) parameters (will be available as PHP variables)


The extension can install hooks of several types:
  1. PHP code
  2. HTML code (printed out as is)
  3. Smarty code (all of features of the Smarty engine are available)
  4. plain text (printed out with the nl2br replacement)

All of these types except PHP code are called from the Smarty engine and to be sent to a browser as a part of the script's response.

2.3.7 script note

The following construction is required for the 2.3.7 script and higher:

if (iaView::REQUEST_HTML == $iaView->getRequestType())
    // your extension's code

This statement is required for the hooks of PHP type.
In case of absence of this check your code may assign variables to output and if, for example, the current request is AJAX or XML request this potentially may break a correct response generation.

Updated by Batyr Mackenov over 7 years ago ยท 2 revisions