Latest JAS v1.1.0
144 plugins online

Plugins / Components / Frontend

The most used plugin component is the frontend. This is used to display actual information on the "frontend" of the website.

Its class name should start with the "Plugin_" followed by the plugin name, e.g. Plugin_skeleton. It generally should contain 2 functions:
  • main
    This should contain the main logic that is needed to make any changes before the page is generated.
  • output
    This should be used to generate the actual page and should return the output for further processing. Note that this function is only called if the main function was executed successfully.

Plugin frontend class
PHP
class Plugin_skeleton extends Base_Plugin
{
  function main()
  {
    //...
  }
  function output()
  {
    //...
  }
}
Additionally there is a (optional) "cache" function that allows the plugin to check whether the cached output is still up-to-date. If it is it will output the cache directly and not call the "output" function. If it isn't up-to-date, the "output" function is called and it's result cached.

Comments (0)