PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Aleksandar Zivanovic   Simple PHP Template Engine   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: This is an example of how it works.
Class: Simple PHP Template Engine
Template engine based on text replacement
Author: By
Last change: added addTag function for adding html tags
Date: 14 years ago
Size: 640 bytes
 

Contents

Class file image Download
<?
include 'class.template.php';
$tmp = new Template('', 'tpl');
$tmp->addTag(array(
        
'textarea1' => array(
            
'textarea' => array(
               
'cols' => 10,
               
'rows' => 10,
               
'value' => 'test'
         
)
          ),
         
'input_text' => array(
              
'input' => array(
                  
'type' => 'text',
                   
'value' => 'test text'
               
)
           )
));
$tmp->loadTemplate('test');
$tmp->set(array(
       
'hello' => date("H:i",time()),
       
'aca' => 'test',
       
'test' => 'bla'
       
)
);
$tmp->output();
?>