Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Frederico R. Galvão  >  TemplateBuilder  >  example.php  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: TemplateBuilder
Powerful and easy class to manage templates
 

Contents

Class file image Download
<?php

include("TemplateBuilder.php");

Class 
Example
{
    var 
$name "Brazil";
    var 
$example = array("Home""Ball""Phone");

    function 
print_other_msg()
    {
        return 
"Hi World! :)";
    }

}

function 
print_msg($msg)
{
    echo(
$msg);
}

function 
print_num($num)
{
    
$ret "<table width=200 align=center cellspacing=2 cellpadding=2 border=0>";
    
    for(
$i 0$i $num$i++)
    {
        
$ret .= "<tr>";
    
$ret .= "<td bgcolor=#ff00ff>".$i."</td>";
    
$ret .= "<td bgcolor=#808080>".($i+1)."</td>";
    
$ret .= "</tr>";
    }
    
    
$ret .= "</table>";

return 
$ret;
}

$title  =  "TemplateBuilder 2.5";
$author = array("hacker" => "Edson C. Melo""fred" => "Frederico R. Galvão");
$msg    "The book is on the table";

$CL = new Example;

$TP = new TemplateBuilder;
$TP->parse_template("parent.html");

?>