<?php
 
//this template example shows how you can call template files INSIDE other template file
 
 
require_once('idtpl.class.php');
 
 
//second flag as false disallows class to store data of all templates.
 
//it needs if you use template_in_template structure of your site
 
$template = new IDtpl('templates/',false); //<--- false here
 
 
//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);
 
 
//this template call other 3 templates insede himeself
 
$template->template('tpl_in_tpl.tpl');
 
 
//and them display all 3 templates
 
$template->display();
 
 
echo $template->exectime();
 
?>
 
 |