PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Nando Vieira   PHPTemplate   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: index page
Class: PHPTemplate
PHP based template engine
Author: By
Last change:
Date: 18 years ago
Size: 532 bytes
 

Contents

Class file image Download
<?php
require_once 'PHPTemplate.class.php';

$rows = array(
                array(
1.1, 1.2, 1.3),
                array(
2.1, 2.2, 2.3),
                array(
3.1, 3.2, 3.3),
                array(
4.1, 4.2, 4.3)
            );

$tpl = new PHPTemplate();
$tpl->add('title', 'My Page title');
$tpl->add('content', '<p>Here is my content!</p>');
$tpl->add('current_year', date('Y'));
$tpl->add('rows', $rows);
$tpl->add('rows_count', count($rows));
$tpl->load('footer', 'footer.tpl');
$tpl->display('template.tpl');
?>