PHP Classes

File: example_outputbuffer.php

Recommend this page to a friend!
  Packages 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: 19 years ago
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();
?>