System:Template:addView

From Aspen Documentation

Adds a template file path to the list of templates to include when the display function is called.

Since 1.0

Contents

Arguments

void addView (string $template)

template
File system path to a template file to be included.

Returns

This function does not return any values.

Notes

  • Templates will be displayed in the same order they were added as views.

Examples

In this example, we're adding three views from within our class code. The first and last templates are from our global application template directory, and the middle template is from our module template directory for the current application.

The last function initiates the display of the loaded templates.

$this->APP->template->addView($this->APP->template->getTemplateDir().DS . 'header.tpl.php');
$this->APP->template->addView($this->APP->template->getModuleTemplateDir().DS . 'index.tpl.php');
$this->APP->template->addView($this->APP->template->getTemplateDir().DS . 'footer.tpl.php');
$this->APP->template->display();