Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > e4bc604c3296a71e8c2c646fd63703f5 > files > 11

php-pear-HTML_Template_PHPLIB-1.5.0-1mdv2010.0.noarch.rpm

<?php

include_once 'HTML/Template/PHPLIB.php';
include_once 'Benchmark/Timer.php';

/**
* "keep" = keep unknown template variables,
* "remove" = remove 'em,
* "comment" = put them into comments
*
* use keep if you have stylesheets or JavaScript
* in your HTML code since those are also using
* { and } which will then get removed.
*/
$t =& new HTML_Template_PHPLIB("./", "keep");
$timer =& new Benchmark_Timer();
$timer->start();

$t->setFile(array(
    "main" => "tpl1.ihtml"
));

$welcome = "Welcome to the real world";

$t->setVar(array(
    "TITLE" => "This is my title",
    "BGCOLOR" => "#cccccc",
    "CONTENT" => $welcome
));

/**
* or, use: $t->pparse("out", array("main"));
*/
$t->parse("out", array("main"));
$t->p("out");
$timer->stop();
$timer->display();
?>