PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ben Vautier   template_bv   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: template_bv
Template engine based on token splitting not regex
Author: By
Last change: Included new method calls
Date: 18 years ago
Size: 1,033 bytes
 

Contents

Class file image Download
<?php

include 'class.template_bv.php';

$_tpl = &new Template_bv('main.tpl');

// Page title
$_tpl->Assign('<TITLE>', 'Fast Templating class.'); // Just an example

// CSS in the Head of the HTML document
$_tpl->Assign('<HEAD>', '<link href="text.css" rel="stylesheet" type="text/css">'); // Just an example
$_tpl->Append('<HEAD>', '<script type="javascript"> function whatever() {}</script>');

// Page header
$_tpl->Assign('<HEADER>', 'Welcome to Template!');
$_tpl->Enclose('<HEADER>', '<h1>', '</h1>');

// Left column
$_tpl->Assign('<LEFT>', 'Left column information');

// Center column
$_tpl->Assign('<CENTER>', '<b>This is the center column.</b>');
$_tpl->Prepend('<CENTER>', 'Add this in front of the the center column. ');
$_tpl->Append('<CENTER>', ' Put this at the end.');


// Right column
$_tpl->Assign('<RIGHT>', 'Right column information');

// Page footer
$_tpl->Assign('<FOOTER>', '<center>Copyright (c) 2006</center>');

// Print to screen
echo $_tpl->PrintTemplate();


?>