File: example.php

Recommend this page to a friend!
  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: 11 years ago
Size: 897 bytes



Class file image Download

//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( 0 => array( 'name'=>'Mario', 'age'=>45 ),
1 => array( 'name'=>'Federico', 'age'=>27 ),
2 => 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="" target="_blank"></a>' );

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

For more information send a message to info at phpclasses dot org.