PHP Classes

File: examples/template_runtime.php

Recommend this page to a friend!
  Classes of Cesar D. Rodas  >  Haanga  >  examples/template_runtime.php  >  Download  
File: examples/template_runtime.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Haanga
Template engine to process Django style templates
Author: By
Last change: Update of examples/template_runtime.php
Date: 3 years ago
Size: 322 bytes
 

Contents

Class file image Download
<?php

require "../lib/Haanga.php";

$fnc = Haanga::compile(<<<EOT
<h1>{{foobar}}{{ foobar }}</h1>

    Este template será compilado a una función PHP ({{foo|default:foobar}})


EOT
);

$fnc(array("foobar" => 'hola', 'foo' => '.I.'), FALSE /* print it */);
$fnc(array("foobar" => 'chau'), FALSE /* print it */);

For more information send a message to info at phpclasses dot org.