Location: PHPKode > scripts > Simple Template class > simple-template-class/example.php
<?php
require_once('class.template.php');
$template = new Template('templates/');

//Preparation some data to display
$data = array(
			array('title' => 'First title', 'link' => 'http://google.com', 'text' => 'And more...'),
			array('title' => 'Second title', 'link' => 'http://google.com', 'text' => 'And more...'),
			array('title' => 'Third title', 'link' => 'http://google.com', 'text' => 'And more...'),
			array('title' => 'Fourth title', 'link' => 'http://google.com', 'text' => 'And more...')
			);
$somevar = 11;
$title = 'Page title';

$template->assign('links', $data);
$template->assign('somevar', $somevar);
$template->assign('title', $title);
$template->display('show.tpl');
?>
Return current item: Simple Template class