| 
<?php
class testclass{
 function test($argv='test'){
 return 'this the class output=>'.$argv;
 }
 }
 function func($argv='test'){
 return 'you type the:'.$argv;
 }
 $StartTime=array_sum(explode(' ',microtime()));
 require('Template.php');
 $Array=array('a'=>1,'b'=>2,'c'=>3);
 $DemoFor=array(0=>array('a'=>1,'b'=>2,'c'=>3),1=>array(0=>'abc',1=>'a',2=>'b',3=>'c'));
 $Tpl=new Template();
 $Tpl->TplPath='./';
 $Tpl->CachePath='./';
 $Tpl->RegFunc('func');
 $Tpl->RegClass('testclass');
 $Tpl->Assign('test','Demo Test');
 $Tpl->Assign('now',time());
 $Tpl->Assign('helloword','HelloWord');
 $Tpl->Assign('array',$Array);
 $Tpl->Assign('demo',$DemoFor);
 $Tpl->Display('example.tpl');//or echo $Tpl->Result('example.tpl');
 echo "Process:".(array_sum(explode(' ', microtime()))-$StartTime);
 ?>
 |