Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of James Glenlake  >  SmashTemplate  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: An example of how to use SmashTemplate
Class: SmashTemplate
Template that replaces placeholders by PHP code
Author: By
Last change:
Date: 10 years ago
Size: 592 bytes
 

Contents

Class file image Download
<?php

require 'template.php';

$tpl = new template('templates');

$tpl->get('template.tpl');

if (
$HTTP_GET_VARS['id'])
{
    
$tpl->set('heading''Link '.$HTTP_GET_VARS['id']);
    
$tpl->set('content''This is link '.$HTTP_GET_VARS['id']);
}
else
{
    
$tpl->set('heading''Main Content');
    
ob_start();
?>
<p align="center">This is a layout designed by James Glenlake. It includes rounded corners, rollover
links, and lossless resizability.</p>
<?php
    $tpl
->set('content'ob_get_contents());
    
ob_end_clean();
}

$tpl->set('title''The Forest');

$tpl->display();

?>