File: tutorial3.php

Recommend this page to a friend!
  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: 17 years ago
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");

?>


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