Template Plugin
Usage Example:
This template plugin allows you to use custom templates. Templates are stores in /Templates/ folder. For this example, lets say the template is in /Template/customTemplate folder:Class /Controller/test.php:
<?php
class test extends mainController
{
public function __construct()
{
parent::__construct();
// Load the HTML page from the viewer
$page = $this->loadViewer("welcome",$someData,true);
/*
List of template variables to change
These variables are in your viewer file like {header }, {footer }, {links }
Each of the above variable must have a page to it in your template folder
/Templates/customTemplate/header.x
/Templates/customTemplate/footer.x
/Templates/customTemplate/links.x
$templateInfo = array("header", "footer", "links");
*/
// Load the plugin
$this->loadPlugin("template");
// Print the page with the template information
echo showTemplate($page,$templateInfo,"customTemplate");
// If your template file is php type, you can pass it variables as well
echo showTemplate($page,$templateInfo,"customTemplate",$someData);
}
}
Installation:
- Extract the file into your /Plugin folder.
- Load the plugin where you like.
System Requirements:
- PHP 4/PHP 5
Related Videos: