PHP Classes

File: example_autoglobal.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Kalle Sommer Nielsen  >  Template Processor  >  example_autoglobal.php  >  Download  
File: example_autoglobal.php
Role: Example script
Content type: text/plain
Description: Example file - Using autoglobals
Class: Template Processor
Template processing engine
Author: By
Last change: Updated to match the latest class version
Date: 8 years ago
Size: 542 bytes


Class file image Download
     * Load class

     * Make object instance and enable the 'autoglobal' and
     * 'allowphp' option
$temp = new Template(Array('allowphp' => true, 'autoglobal' => true));

     * Define some variables outside the template
$variable = 'Hello World';

     * Add a custom piece of code, that will show the value
     * of our variable when compiling
$temp->addcache("<?php echo(\$variable); ?>");

     * Compile