Client Area Output

Addon Modules also support generating client area output. This is done with the use of an _clientarea function within the module.

The functionality allows for modules to return output in the form of template files. The template files are stored within the module folder.

You can return a page title, breadcrumb path, and template variables. You can also require a client login with a simple true/false response. Language strings from the modules language file (see here) are also available.

Access Client area modules using an URL in the format /client/module/modulename

Client Area Function Example:

Here is a sample client area function demonstrating all the available return variables:

<?php
function yourmodule_clientarea($params=[])
{
 return [
        'pagetitle' => 'Addon Module',
        'breadcrumb' => ['/client/module/modulename'=>'Demo Addon'],
        'templatefile' => 'addonhome',
        'requirelogin' => true, # accepts true/false
        'vars' => [
            'testvar' => 'demo',
            'anothervar' => 'value',
            'sample' => 'test',
        ],
    ];
}

The above assumes a template, addonhome.tpl, existing within the module folder to use for the output.