Location: PHPKode > scripts > Separated Template > separated-template/example.php
<?php
include('sTemplate.class.php');

$tpl = new sTemplate;

$tpl->dir = './templates/'; // Use only if you have another directory name - this is default
$tpl->ext = '.html'; // Like dir - use if you have another
$tpl->atr = 'class'; // Like dir and ext - use if you want to use another attribute in html

// Load 2 times template 'each', send objects 'my-class1' and 'my-class2', don't display
$p = $tpl->load('each', array('my-class1' => 'Text1', 'my-class2' => 'Text2'), false);
$p .= $tpl->load('each', array('my-class1' => 'Text3', 'my-class2' => 'Text4'), false);

// Load template 'main', send objects 'title' and 'content', display result
$tpl->load('main', array('title' => 'Anything', 'content' => $p), true);
?>
Return current item: Separated Template