File: test/test-delims.js

Recommend this page to a friend!
  Classes of Nikos M.  >  Grammar Template  >  test/test-delims.js  >  Download  
File: test/test-delims.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Grammar Template
Template engine in PHP and other languages
Author: By
Last change:
Date: 7 months ago
Size: 507 bytes
 

 

Contents

Class file image Download
var GrammarTemplate = require("../src/js/GrammarTemplate.js"), echo = console.log;

echo('GrammarTemplate.VERSION = ' + GrammarTemplate.VERSION);
echo( );

var tpl = "\\\\[var]\n\\[[var2]\\][[ \\[[var2]*\\]]][[# comment #]]\n[foo]\\?[foo] ?";

var grm = new GrammarTemplate( tpl, ['[',']','[[',']]'], true );
echo("input template:");
echo(tpl);

echo( );

echo("output:");
echo(grm.render({
    "foo"   : "foo",
    "var"   : "var",
    "var2"  : [
        "var1",
        "var2",
        "var3"
    ]
}));

For more information send a message to info at phpclasses dot org.