PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Luke Szanto  >  Tamplate  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example of the usage of Tamplate
Class: Tamplate
Template engine that replaces variables with text
Author: By
Last change:
Date: 6 years ago
Size: 637 bytes


Class file image Download

//Include the class
include "Tamplate.class.php";

//Create a new instance of the class
$tamplate = new Tamplate();

//You can set the variables individually or as an array

//Set the variables
$tamplate->set_var("title", "Example site");
$tamplate->set_var("heading", "The example site");
$tamplate->set_var("message", "Welcome to my example site, I hope you enjoy it");

//$tamplate->set_var(array("title" => "Example site", "heading" => "The example site", "mesage" => "Welcome to my example site, I hope you enjoy it"));

//Show the teamplate