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 Federico  >  RainTPL  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: RainTPL
HTML template engine caches compiled results
Author: By
Last change:
Date: 4 years ago
Size: 897 bytes
 

Contents

Class file image Download
<?php

    
//include the RainTPL class
    
include "includes/rain.tpl.class.php";

    
//initialize a Rain TPL object
    
$tpl = new RainTPL'themes' );
    
    
//variable assign example
    
$variable "CIAO, BELLA GIORNATA?";
    
$tpl->assign"variable"$variable );
    
    
//loop example
    
$week = array( 'lunedý''martedý''mercoledý''giovedý''venerdý''sabato''domenica' );
    
$tpl->assign"week"$week );
    
    
    
//loop example 2
    
$user = array( => array( 'name'=>'Mario''age'=>45 ),
                   
=> array( 'name'=>'Federico''age'=>27 ),
                   
=> array( 'name'=>'Giovanna''age'=>32 )
    );
    
$tpl->assign"user"$user );
    
    
    
//assign the template variable copyright
    
$tpl->assign'copyright''Copyright 2006 Rain TPL<br>Project By <a href="http://www.rainelemental.net" target="_blank">RainElemental.net</a>' );

    
//draw the template    
    
echo $tpl->draw'page' );
    
    
?>