PHP Classes

File: index_no_comment.php

Recommend this page to a friend!
  Classes of Ákos Nikházy   Small Template Framework   index_no_comment.php   Download  
File: index_no_comment.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Small Template Framework
Output text replacing templates with parameters
Author: By
Last change:
Date: 15 days ago
Size: 1,310 bytes
 

Contents

Class file image Download
<?php
/***********************
    Nikházy Ákos

index_no_comment.php

The idea is keeping PHP clean from HTML and text.
***********************/

require 'require/head.php';


$cache = new Cache(10);
                                   
$template = new Template('index');
$listLineTemplate = new Template('listItem');

$rawTextTemplate = new Template('',' {{texthere}} at rendering');

$text = new Text('index');

$list = '';

for(
$i = 1; $i<=10; $i++)
{
   
   
$listLineTemplate -> tagList['item'] = $text->PrintText('listItemText') . $i;
   
$list .= $listLineTemplate -> Templating(true,false);
   
}
       
$template -> tagList['someText'] = $text->PrintText('someText');
$template -> tagList['content'] = 'This is the content. You should use the Text.class to put text in these parts,
                                    but for the example I write this here. Also this only makes sense if you see
                                    it in the PHP code in index.php'
;
                               
$template -> tagList['aList'] = $list;

$template -> tagList['otherHTML'] = NULL;

$rawTextTemplate -> tagList['texthere'] = $text -> PrintText('complete');
$template -> tagList['rawStringExample'] = $rawTextTemplate -> Templating();
$template -> tagList['formatedText'] = $text -> PrintText('formatedText','string',3,3.3);

$cache -> cache($template -> Templating());