PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of lazy   STC   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: STC
Template engine compiler with caching support
Author: By
Last change: new version example.
Date: 17 years ago
Size: 809 bytes
 

Contents

Class file image Download
<?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);
?>