PHP Classes

File: test/01-inheritance/test.php

Recommend this page to a friend!
  Classes of Nikos M.   Contemplate   test/01-inheritance/test.php   Download  
File: test/01-inheritance/test.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Contemplate
Template engine that provides programming controls
Author: By
Last change:
Date: 2 years ago
Size: 718 bytes
 

Contents

Class file image Download
<?php
define
('ABSPATH', dirname(__FILE__));
function
echo_($s)
{
    echo
$s . PHP_EOL;
}
include
dirname(dirname(ABSPATH)).'/src/php/Contemplate.php';
Contemplate::setCacheDir(ABSPATH);
Contemplate::setCacheMode(Contemplate::CACHE_TO_DISK_AUTOUPDATE);
if ( !
Contemplate::hasTpl('tpl1') ) Contemplate::add(array('tpl1' => ABSPATH. '/tpl1.html'));
if ( !
Contemplate::hasTpl('tpl2') ) Contemplate::add(array('tpl2' => ABSPATH. '/tpl2.html'));
if ( !
Contemplate::hasTpl('tpl3') ) Contemplate::add(array('tpl3' => ABSPATH. '/tpl3.html'));

echo_("--tpl1--");
echo_(Contemplate::tpl("tpl1", array()));
echo_("--tpl2--");
echo_(Contemplate::tpl("tpl2", array()));
echo_("--tpl3--");
echo_(Contemplate::tpl("tpl3", array()));