PHP Classes

File: test/07-folders/test.js

Recommend this page to a friend!
  Classes of Nikos M.   Contemplate   test/07-folders/test.js   Download  
File: test/07-folders/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: 726 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(path.join(__dirname, '/cache')); Contemplate.setCacheMode(Contemplate.CACHE_TO_DISK_AUTOUPDATE); Contemplate.add({'tpl.html' : path.join(__dirname, '/tpl.html')}); Contemplate.add({'folder1/subfolder1/tpl1.html' : path.join(__dirname, '/folder1/subfolder1/tpl1.html')}); Contemplate.add({'folder2/tpl2.html' : path.join(__dirname, '/folder2/tpl2.html')}); echo("--tpl--"); echo(Contemplate.tpl("tpl.html", {})); echo("--tpl1--"); echo(Contemplate.tpl("folder1/subfolder1/tpl1.html", {})); echo("--tpl2--"); echo(Contemplate.tpl("folder2/tpl2.html", {}));