PHP Classes
Icontem

File: demo/index.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David N. Q. Duong  >  XIRE  >  demo/index.php  
File: demo/index.php
Role: Example script
Content type: text/plain
Description: Demo Script
Class: XIRE
Template engine extensible with plug-in classes
 

Contents

Class file image Download
<?php
/***
 * XIRE - eXtendable Information Rendering Engine
 * ----------------------------------------------
 * LICENSE
 * Copyright (C) 2006  David Duong
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
// Include the Template class
require_once '../lib/Template.class.php';

// Instantiate a template object
$template = new XIRE_Template('index.tpl');

// Variables are usually 'pushed' onto the template by the programmer, but a plugin can also 
//   'pull' data to a template
$template->set('variable''test variable');
$template->set('true'true);
// You could also pretend that $template is an array
$template['var'] = array('x''y''z');
$template['false'] = false;

// Process the template
$template->process();

// Send XML to browser
header('content-type: text/xml');
echo 
$template->getXML(true); // You could also save the results into a file with 
                              //   $template->save('filename')
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products