AbstractContentModule Class Reference

Detailed Description

AbstractContentModule is the base class for content module implementations.

Each content module is supposed to be associated with a template file that defines the output.

The cache id of the template is calculated from the cacheId of the parent template and the name of the module and an optional "cacheId" plugin parameter that is only necessary, if the same module is used several times in the same parent template.

Definition at line 27 of file AbstractContentModule.php.

Public Member Functions

 __construct ($name, \Smarty_Internal_Template $parentTemplate, array $params)
 render ()

Protected Member Functions

 getRequiredTemplateVars ()
 getTemplateFile ()
 assignContent (View $view, array $params)

Constructor & Destructor Documentation

◆ __construct()

__construct (   $name,
\Smarty_Internal_Template  $parentTemplate,
array  $params 


$nameTemplate filename name without .tpl extension (must exist in templates/modules)
$parentTemplateTemplate object that includes this content module
$paramsAssociative array of parameters passed to the smarty plugin

Definition at line 41 of file AbstractContentModule.php.

Member Function Documentation

◆ render()

render ( )

Render the module.

Definition at line 84 of file AbstractContentModule.php.

◆ getRequiredTemplateVars()

getRequiredTemplateVars ( )

Get the names of the scalar template variables required from the parent template, object variables must be created and assigned in the assignContent() method.

Array of string

◆ getTemplateFile()

getTemplateFile ( )

Get the template file name.


◆ assignContent()

assignContent ( View  $view,
array  $params 

Assign the content to the view.

$paramsParameter array passed to the module plugin