<?php //include the RainTPL class include "inc/rain.tpl.class.php"; //initialize a Rain TPL object $tpl = new RainTPL( 'tpl' ); //variable assign example $variable = "Hello World!"; $tpl->assign( "variable", $variable ); //loop example $week = array( 'Monday', 'Tuersday', 'Wednesday', 'Friday', 'Saturday', 'Sunday' ); $tpl->assign( "week", $week ); //loop example 2 $user = array( 0 => array( 'name'=>'Sheska', 'age'=>19 ), 1 => array( 'name'=>'Federico', 'age'=>29 ), 2 => array( 'name'=>'Giuseppe', 'age'=>2 ), ); $tpl->assign( "user", $user ); $info = array( 'title'=>'Rain TPL Example', 'copyright' => 'Copyright 2006 - 2010 Rain TPL<br>Project By <a href="http://www.federicoulfo.it" target="_blank">Federico Ulfo . it</a>' ); $tpl->assign( $info ); //draw the template echo $tpl->draw( 'page' ); ?>