PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Reynier Blanco   ubtemplate   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: ejemplo
Class: ubtemplate
Template engine based on block replacing
Author: By
Last change: adding functionalities
Date: 15 years ago
Size: 1,097 bytes
 

Contents

Class file image Download
<?php
include_once("template.php");
include_once(
"test_d.php");
include_once(
"option.php");

$b = array(
        array(
'value' => 0, 'text' => "a"),
        array(
'value' => 1, 'text' => "b"),
        array(
'value' => 2, 'text' => "c"),
        array(
'value' => 3, 'text' => "d"),
        array(
'value' => 4, 'text' => "e"),
        array(
'value' => 5, 'text' => "f"),
        array(
'value' => 6, 'text' => "g"),
        array(
'value' => 7, 'text' => "h"),
        array(
'value' => 8, 'text' => "i")
    );

$tr = array(
        new
option(10,"celda a"),
        new
option(11,"celda b"),
        new
option(12,"celda c"),
        new
option(13,"celda d"),
        new
option(14,"celda e"),
        new
option(15,"celda f"),
        new
option(16,"celda g"),
        new
option(17,"celda h"),
        new
option(18,"celda i")
    );


ubTemplate::$path = "";
$template = new ubTemplate('ex');

$template->set_vars(array(
   
'var' => "prueba de variable",
   
'b' => $b,
   
'tr' => $tr
));

$template->set_block('a');
$template->add_ignore('a','c');

echo
$template->parser();
echo
"------------------------------------------------------------------<br>";

echo
ubTemplate::parser_block_file("ex",'a',new test_d())
?>