Login   Register  
PHP Classes
elePHPant
Icontem

File: tutorial3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Spank Mayer  >  hierarchytemplate  >  tutorial3.php  >  Download  
File: tutorial3.php
Role: Example script
Content type: text/plain
Description: Script Example 3
Class: hierarchytemplate
Template engine that can handle more than one file
Author: By
Last change: to the new versio
Date: 2003-04-27 18:08
Size: 971 bytes
 

Contents

Class file image Download
<?php
    
include_Once("class.template.php");

    
$tpls = new template;
    
$tpls->tplsAreHere(Array("MAIN"=>"tutorial3-main.tpl",
                              
"ROW"=>"tutorial3-rows.tpl"));

    
$tpls->t["MAIN"]->Values(Array("Time"=>Date("Y.m.d. H:i:s")));

    
$Art_URL=Array("Tangerine Dream"=>"http://www.tangerinedream.org/",
                     
"Klaus Schulze"=>"http://www.klaus-schulze.com/",
                 
"Loreena McKennitt"=>"http://www.quinlanroad.com/",
                     
"Mike Oldfield"=>"http://www.mikeoldfield.com/");

    ForEach(
$Art_URL as $art=>$url){
        
$tpls->t["ROW"]->c["ARTS"]->Values(Array("Artist"=>$art,
                                         
"URL"=>$url));
        
$tpls->t["ROW"]->c["ARTS"]->NextRound();
    }
    
$tpls->t["ROW"]->c["ARTS"]->PushUp();
    
//The complet ROW template go into a simple template variable, wich are in a other template.
    
$tpls->t["MAIN"]->Values(Array("Art"=>$tpls->t["ROW"]->GetOut()));

    Print 
$tpls->GetOut("MAIN");

?>