PHP Classes

File: test/01-inheritance/test.js

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

Contents

Class file image Download
"use strict"; const path = require('path'), echo = console.log; const Contemplate = require(path.join(__dirname, '../../src/js/Contemplate.js')); Contemplate.setCacheDir(__dirname); Contemplate.setCacheMode(Contemplate.CACHE_TO_DISK_AUTOUPDATE); if (!Contemplate.hasTpl('tpl1')) Contemplate.add({'tpl1' : path.join(__dirname, '/tpl1.html')}); if (!Contemplate.hasTpl('tpl2')) Contemplate.add({'tpl2' : path.join(__dirname, '/tpl2.html')}); if (!Contemplate.hasTpl('tpl3')) Contemplate.add({'tpl3' : path.join(__dirname, '/tpl3.html')}); echo("--tpl1--"); echo(Contemplate.tpl("tpl1", {})); echo("--tpl2--"); echo(Contemplate.tpl("tpl2", {})); echo("--tpl3--"); echo(Contemplate.tpl("tpl3", {}));