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 
)

Constructor.

Parameters
$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 ( )
abstractprotected

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

Returns
Array of string

◆ getTemplateFile()

getTemplateFile ( )
abstractprotected

Get the template file name.

Returns
String

◆ assignContent()

assignContent ( View  $view,
array  $params 
)
abstractprotected

Assign the content to the view.

Parameters
$view
$paramsParameter array passed to the module plugin