3rd Party Modules & Code Hooks
SPBAS offers a variety of code hooks that are triggered as various events unfold at runtime. You can use the code hooks to extend the core functionality of SPBAS via 3rd party modules. This article will show you how.
How it works.
3rd party modules consist of directories and files named a certain way that are stored at specific locations within SPBAS. The core components of every 3rd party module are the module directories, code hooks and settings files.
The module directory names must consist of only letters and numbers (A-Z, a-z, 0-9). The first character of your module name must be a letter (A-Z, a-z). Use the underscore character instead of spaces (_) when naming your module.
For this article our module name is example.
Code hooks are PHP functions that are triggered at runtime for specific events as they occur. The functions are stored in the core component file run.php. It is very important to note that code hooks are prefixed with the module directory name.
The code hooks file is named run.php and will contain only code hooks.
The settings files are optional. You'll only need them if your module needs to be configured from the admin area. The files will always be named settings.php
File A is the form handler (model) while file B is the template (view).
Available Code Hooks
Replace the * in the code hooks above with the module directory name (e.g. example_admin_update_user) and store the functions in run.php.
Putting it all together
You can use the Example module in the SPBAS distribution to create your own. Have questions?