PHP Classes

File: tutorial2.php

Recommend this page to a friend!
  Classes of Spank Mayer   hierarchytemplate   tutorial2.php   Download  
File: tutorial2.php
Role: Example script
Content type: text/plain
Description: Script Example 2
Class: hierarchytemplate
Template engine that can handle more than one file
Author: By
Last change: to the new versio
Date: 21 years ago
Size: 857 bytes
 

Contents

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

   
$tpls = new template;
   
$tpls->tplsAreHere(Array("MAIN"=>"tutorial2.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["MAIN"]->c["ROWS"]->Values(Array("Artist"=>$Art,
                                                    
"URL"=>$url));
       
$tpls->t["MAIN"]->c["ROWS"]->NextRound();
    }
   
//ROWS is a included child template.
    //his value must lift up into the parent template
   
$tpls->t["MAIN"]->c["ROWS"]->PushUp();


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