Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/page.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Victor Akinyemi  >  Lint  >  examples/page.php  >  Download  
File: examples/page.php
Role: Example script
Content type: text/plain
Description: The processing script for 'template256.php' and 'template257.php'
Class: Lint
PHP compiling template engine
Author: By
Last change:
Date: 1 year ago
Size: 1,448 bytes
 

Contents

Class file image Download
<?php
require('lint_0_2_1.php');
$page $_GET['p'];
$rpa = array('title'=>'Lint v0.2alpha test page','css'=>'#pageContent {
background-color: rgb(230,230,230);
}
.content {
background-color: rgb(255,255,255);
}'
,'c1'=>'<p>Lint v0.2alpha test page<br>
A new version of Lint has been released!!! Features:<br>
<ul>
<li>Now in OOP - Lint has put the <b>O</b>bject <b>O</b>riented <b>P</b>rogramming concept to use!</li>
<li>Multiple templates - Thanks to the generation of a unique and random template file for each "LintTemplate" instance, you can now process multiple templates in one PHP script!</li>
<li>Template Manager - In order to make processing multiple templates in one PHP script easier, a "LintManager" class has been developed.</li>
</ol>
</p>'
);
$rpa2 = array('title'=>'Page 2',
'content' =>'<h1>Second Page!</h1>');
$tmp1 = new LintTemplate('template256.tpl',$rpa);
$tmp2 = new LintTemplate('template257.tpl',$rpa2);
$ids = array('tmp1'=>$tmp1->getId(),
'tmp2'=>$tmp2->getId());
$manager = new LintManager(array($tmp1,$tmp2));
if (
$page == '1') {
$manager->setCurrentTemplate($ids['tmp1'])->renderCurrentTemplate();
$manager->removeTemplates(array($ids['tmp1'],$ids['tmp2']));
}elseif (
$page == '2') {
$manager->setCurrentTemplate($ids['tmp2'])->renderCurrentTemplate();
$manager->removeTemplates(array($ids['tmp1'],$ids['tmp2']));
}else{
$manager->removeTemplates(array($ids['tmp1'],$ids['tmp2']));
die(
"Unknown page: {$page}");
}
?>