Location: PHPKode > scripts > IDtpl3 > idtpl3/example1.php
<?php

require_once('idtpl.class.php');
$template = new IDtpl('templates/');

//Preparation some example data to display
$title= 'Page title';
$variable= 256;
$data = array(
	array('title'=>'Link one', 'link'=>'http://google.com/', 'text'=>'some description...'),
	array('title'=>'Link two', 'link'=>'http://google.com/', 'text'=>'some description...'),
	array('title'=>'Link three', 'link'=>'http://google.com/', 'text'=>'some description...'),
	array('title'=>'Link four', 'link'=>'http://google.com/', 'text'=>'some description...')
);

$template->define('title', $title);
$template->define('links', $data);
$template->define('var', $variable);

//you can parse tpl and show html directly
$template->template('header.tpl');
$template->display();
$template->template('content.tpl');
$template->display();
//or parse tpl and get html code by using get_output
$template->template('footer.tpl');
echo $template->gethtml();

echo $template->exectime();
?>
Return current item: IDtpl3