PHP Classes

File: test/03-literal-code/test.php

Recommend this page to a friend!
  Classes of Nikos M.   Contemplate   test/03-literal-code/test.php   Download  
File: test/03-literal-code/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: 385 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';

// global ctx
Contemplate::setCacheDir(ABSPATH);
Contemplate::setCacheMode(Contemplate::CACHE_TO_DISK_AUTOUPDATE);
Contemplate::add(array('test' => ABSPATH . '/test.html'));

echo_(Contemplate::tpl('test', array('list'=>[1,2,3])));