Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/if.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of tokkara  >  Simphple  >  examples/if.php  >  Download  
File: examples/if.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simphple
Process templates compiling into PHP code
Author: By
Last change: simphple version 1.1.0
Date: 1 year ago
Size: 980 bytes
 

Contents

Class file image Download
<?php
include '../simphple/data_store/data_store.intfc.php';
include 
'../simphple/data_store/data_store_file.class.php';

include 
'../simphple/template/template_code.class.php';
include 
'../simphple/template/template.class.php';
include 
'../simphple/template/template_function.class.php';
include 
'../simphple/template/template_tools.class.php';

define('FEMALE'1);
define('MALE'2);

$dsf = new Sphp_Data_Store_File('cache/'truetrue);
$options = array('debug' => true'template_dir_path' => 'templates/''vars_without_keys' => Sphp_Template::VARS_WK_ENABLED_MODIFIERS);
$tpl = new Sphp_Template($dsf$options);

if(isset(
$_POST['number']))
    
$tpl->add_variable('number', (int)$_POST['number']);
if(isset(
$_POST['gender']))
    
$tpl->add_variable('gender', (int)$_POST['gender']);
if(isset(
$_POST['age']))
    
$tpl->add_variable('age', (int)$_POST['age']);

$tpl->add_function(new Sphp_Template_Function('is_numeric'));-

$tpl->display_file('if.html');