Login   Register  
PHP Classes
elePHPant
Icontem

File: example_outputbuffer.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Kalle Sommer Nielsen  >  Template Processor  >  example_outputbuffer.php  >  Download  
File: example_outputbuffer.php
Role: Example script
Content type: text/plain
Description: Example file - Using basic output buffering
Class: Template Processor
Template processing engine
Author: By
Last change:
Date: 2007-01-20 17:30
Size: 535 bytes
 

Contents

Class file image Download
<?php
    
/**
     * Include the class
     */
    
require_once('./template.class.php');

    
/**
     * Construct
     */
    
$temp = new Template();

    
/**
     * Start output buffer using ob_start() before 
     * outputting anything, else it won't work!
     */
    
ob_start();

    
/**
     * Configure to clean output before compiling
     */
    
$temp->set_option('cleanoutput'true);

    
/**
     * Print some random data out
     */
    
echo("Foo");

    
/**
     * Add some cache
     */
    
$temp->addcache('Bar');

    
/**
     * Compile
     */
    
$temp->compile();
?>