PHP Classes

File: test/07-folders/test.php

Recommend this page to a friend!
  Classes of Nikos M.   Contemplate   test/07-folders/test.php   Download  
File: test/07-folders/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: 726 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.'/cache');
Contemplate::setCacheMode(Contemplate::CACHE_TO_DISK_AUTOUPDATE);
Contemplate::add(array('tpl.html' => ABSPATH. '/tpl.html'));
Contemplate::add(array('folder1/subfolder1/tpl1.html' => ABSPATH. '/folder1/subfolder1/tpl1.html'));
Contemplate::add(array('folder2/tpl2.html' => ABSPATH. '/folder2/tpl2.html'));

echo_("--tpl--");
echo_(Contemplate::tpl("tpl.html", array()));
echo_("--tpl1--");
echo_(Contemplate::tpl("folder1/subfolder1/tpl1.html", array()));
echo_("--tpl2--");
echo_(Contemplate::tpl("folder2/tpl2.html", array()));