PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Erick Anthony de Oliveira Carvalho   Simple Template System   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Simple Template System
Template engine based on replacing text strings
Author: By
Last change:
Date: 12 years ago
Size: 684 bytes
 

Contents

Class file image Download
<?php
// -- Simple Template System
// -- Powered by Erick-Master
// -- CTM TEAM Softwares
// -- www.ctmts.com.br
// -- erick-master@ctmts.com.br
// -- 29/04/2011
// -- example.php

require_once("template.class.php");

define("TITLE", "Teste"); // -- Page Title
$template = new template(); // -- Load Class

$template->set("TITLE", TITLE); // -- Add the tag {TITLE}, loading the constant "TITLE"

switch($_GET["page"])
{
    case
"home" :
   
$template->fread("template/index.tpl.php"); // -- Load the index.tpl.php
   
break;
    default :
   
$template->fread("template/index.tpl.php"); // -- Load the index.tpl.php
   
break;
}

$template->show(); // -- Show template

?>