PHP Classes

Contemplate: Template engine that provides programming controls

Recommend this page to a friend!
  Info   View files Documentation   Demos   Screenshots Screenshots   View files View files (132)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 84 This week: 1All time: 10,019 This week: 560Up
Version License PHP version Categories
contemplate 1.6.0Artistic License5PHP 5, Templates
Description 

Author

This package implements a template engine that provides programming controls.

It can process a given template string to render it by processing the template tags like a programming language.

The template format may contain placeholder marks that define where values may be inserted from variables or supported functions.

It also supports programming controls like process sections depending on the evaluation of conditions and iteration of sections like loops.

The package also provides the implementation of the same template engine in JavaScript and Python besides PHP.

Picture of Nikos M.
Name: Nikos M. is available for providing paid consulting. Contact Nikos M. .
Classes: 17 packages by
Country: Greece Greece
Age: 47
All time rank: 8609 in Greece Greece
Week rank: 14 Up2 in Greece Greece Up
Innovation award
Innovation award
Nominee: 7x

Winner: 2x

Documentation

Contemplate Manual

version 1.6.0; platforms: PHP, Python, JavaScript (Node.js, Browser, XPCOM)

Contents

  1. Template Separators
  2. Template Variables
  3. Literal Template Data
  4. Dynamic Template Inheritance
  5. Dynamic Contexts
  6. Template Directives
  7. Template Functions and Plugins 1. Differences between include and template
  8. Contemplate API

Template Separators

IMPORTANT As of version 0.6+, template separators for Contemplate templates are defined inside the template itself in the first non-empty line, separated by a space (see examples and tests). Optionally (for a single template) they can also be passed as part of parse options when calling the Contemplate.tpl(tplID [, data, {separators: seps}]) method

Template Variables

Variables in a template are referenced using PHP-style Notation with $ sign. Note Object properties are referenced using (php-style) arrow notation (->)

example:


// single variable
$x, $v, $foo, $bar
// etc..

// numeric/associative array access notation, equivalent notations
//================================================================
$obj["key"]
$obj.key

$obj[0]["key"]
$obj[0].key

$obj["key"][0]
$obj.key[0]

$obj["key"].key2
$obj.key["key2"]
$obj.key.key2

// access associative array property, property name is dynamic and given in variable $prop
$obj[$prop]

// object access notation
//=======================
$obj->prop
$obj->method(..args)
$obj->prop->prop2
$obj->prop->method(..args)
$obj->method1(..args)->method2(..args)
$obj->method(..args)->prop

// arbitrary expressions in brackets
//=======================
$var[1+n($index)][cc("foo","bar")]


// any valid combination of the above..


// alternatively to access variable (nested) properties based on arbitrary expressions use built-in `get` directive e.g:
get($var, [1+n($index), urlencode("foo")])
// equivalent to:
$var[1+n($index)][ urlencode("foo") ]

// also `get` directive can access properties which have associated dynamic getter methods,
// i.e access computed property `computed` which is dynamicaly computed by an associated `getComputed` method
get($var, ["computed","otherProp"])
// will try to access $var->getComputed()->otherProp

// etc..

Literal Template Data

Literal object/array data are constructed in a template using JavaScript Literal Object-style Notation (similar to JSON)

example:


// eg. a literal object having various string values, numeric values and arrays:
{
    "stringVar"     : "stringValue",
    "numericVar"    : 123,
    "variableVar"    : $foo123,
    "arrayVar"      : [
        0, 1, "astring", 3,
        { "prop": 1 }
    ]
} // etc

Dynamic Template Inheritance

Templates can extend another template. This is accomplished using extends directive, inside the template. This means that the super-template (id) is hardcoded inside the cached template (once compiled).

Right now there are 2 ways to have dynamic template extension according to a condition based on input data.

1st is to assign the super-template id (i.e as used in extends(id) ) to another template. In this way the template id used in extends directive will refer to a different template. This will change the referenced super-template for all other templates that extend the same super-template as well.

2nd way is on a template-by-template basis. Example:

// fetch/parse the template
tpl = Contemplate.tpl(tplID);

// tpl may already have a super-template assigned, but one can change this
if ('json' == data.view)  tpl.extend(newSuperTemplateID);

tpl.render(data);

Dynamic Contexts

The engine can use multiple dynanic contexts to have contextual settings, like templates, caching, plugins so that different modules of an application can use the engine independantly.

A dynamic context is created with Contemplate.createCtx('my-context'); A dynamic context is disposed with Contemplate.disposeCtx('my-context');

If a context already exists, it is not re-created in createCtx method. If a context does not already exist, disposeCtx method does nothing.

All other API methods of Contemplate can accept a context id (so operations take place in that context) either via options (in methods that accept an options parameter) or via an additional ctx string parameter (see examples).

If no context is given, API operations take place in the global context "global". TEMPLATE operations take place in the current context (which defaults to global if no other context specified)

Template Directives

IMPORTANT As of version 1.0.0+, template directives, functions and plugins no longer use the % prefix i.e %for, %if, .. but for, if, ..

  • `local($var)` DEFINE a local variable with literal name "var". Some variable names are reserved and an error will be thrown
  • `set($var, expression_or_value)` SET / UPDATE a tpl or local variable `$var` to given value or expression
  • `local_set($var, expression_or_value)` SET / UPDATE a local tpl variable `$var` to given value or expression
  • `get($var, keys [, default_value=null])` GET arbirtary (nested) variable property (given in `keys` array) based on arbitrary expressions, else return `default_value` if not found
  • `unset($var)` UNSET / DELETE tpl variable `$var`
  • `isset($var)` CHECK whether a tpl variable `$var` is set
  • `iif(cond, then_value, else_value)` inline (ternary) `IF` construct
  • `empty(val)` php-like `empty` construct
  • `if(expression_or_value)` IF construct
  • `elseif(expression_or_value)` / `elif(expression_or_value)` ELSEIF construct
  • `else` ELSE construct
  • `endif` / `fi` ENDIF construct, end the IF construct
  • `for(expression_or_obj as $key => $val)` associative FOR loop (`php`-style)
  • `for(expression_or_obj as $val)` non-associative FOR loop (`php`-style)
  • `for($key, $val in expression_or_obj)` associative FOR loop (`python`-style)
  • `for($val in expression_or_obj)` non-associative FOR loop (`python`-style)
  • `elsefor` ELSEFOR, alternative code block when loop is empty
  • `endfor` ENDFOR , end the FOR loop construct
  • `continue` CONTINUE , continue the FOR loop construct
  • `break` BREAK , break from the FOR loop construct
  • `extends(base_tpl_id_string)` Current template extends the template referenced by `base_tpl_id_string` , this means that `base_tpl` layout will be used and any blocks will be overriden as defined
  • `block(block_id_string, echoed=true)` Define / Override `block` of code identified by `block_id`
  • `endblock` End of `block` definition / override
  • `super(block_id_string)` Reference a super `block` directly if needed in OO manner (mostly useful inside `block` definitions overriden by current template)
  • `getblock(block_id_string)` Get `block` output directly via function call (can be useful when `block` content is needed as a parameter)
  • `include(tpl_id_string)` INCLUDE (inline) the template referenced by `tpl_id`

As of version 1.5.0+, literal PHP or JS or PY code can be included in template. Assuming template separators as <%, %> one can include programming code directly in the template, which will include it only if the language is the language of the engine (ie php will include only php code, js only js code ad py ony py code, rest will simply be ignored).

Example:

<% for ($v in $list) %>
<% $v %> <%php:= "php" %><%js:= "js" %><%py:= "py" %>
<% endfor %>

The above will output in PHP (assuming list = ['a', 'b', 'c']):

a php b php c php

The above will output in JS (assuming list = ['a', 'b', 'c']):

a js b js c js

The above will output in PY (assuming list = ['a', 'b', 'c']):

a py b py c py

One can include block code as well (leaving out the = mark)

<%php:postdent(1):
foreach ($data['list'] as $v)
{
%>
<%js:postdent(1):
for (var i=0; i<data['list'].length; ++i)
{
    var v = data['list'][i];
%>
<%py:postdent(1):
for v in data['list']:
%>

<%php:= $v . " php" %><%js:= v + " js" %><%py:= v + " py" %>

<%php:predent(-1):
}
%>
<%js:predent(-1):
}
%>
<%py:predent(-1):

%>

The above will output exactly the same as previous example in each engine (assuming list = ['a', 'b', 'c']).

:predent()/:postdent() option specifies the indentation of the block of code (before/after) in the compiled output. It is optional for PHP/JS (only for visual purposes) but mandatory for Python since Python depends on valid indentation.

Template Functions and Plugins

IMPORTANT As of version 1.0.0+, template directives, functions and plugins no longer use the % prefix i.e %for, %if, .. but for, if, ..

  • `n(val)` convert `val` to integer
  • `s(val)` convert `val` to string
  • `f(val)` convert `val` to float
  • `q(val)` wrap `val` in single-quotes
  • `qq(val)` / `dq(val)` wrap `val` in double-quotes
  • `concat(val1, val2, val3, ..)` / `cc(val1, val2, val3, ..)` concatenate the values as strings
  • `join(sep, [val2, val3, ..], skip_empty=false)` / `j(sep, [val2, val3, ..], skip_empty=false)` (flatly) string-concatenate with `sep` separator the passed array (of arrays)
  • `is_array(val [, strict=false])` (`php`-like) function test whether `val` is `array` (`strict`) or `object`
  • `in_array(val, array)` (`php`-like) function test whether `val` is contained in `array`
  • `keys(obj)` (`php`-like) for `array_keys`
  • `values(obj)` (`php`-like) for `array_values`
  • `count(array_or_object)` return number of items in `array_or_object` argument
  • `haskey( array_or_object, key1 [,key2, ..] )` check whether `array_or_object` argument has the given (nested) keys
  • `time()` / `now()` return current timestamp in seconds (`php`-like function)
  • `date(format [, timestamp=now])` return timestamp formatted according to format
  • `striptags(string)` strip `html tags` from string
  • `e(val)` custom fast html escape
  • `json_encode(val)` (`php`-like) function to json-encode `val`
  • `json_decode(val)` (`php`-like) function to json-decode `val`
  • `urlencode(str)` urlencode (`php`-like) function
  • `urldecode(str)` urldecode (`php`-like) function
  • `buildquery(data)` `php`-like function `http_build_query` to make a query string from structured data
  • `parsequery(str)` `php`-like function `parse_str` to parse a query string to structured data
  • `queryvar(url, add_keys, remove_keys=null)` add/remove `url query` keys, given in `add_keys` and `remove_keys` respectively, from given `url`
  • `lowercase(val)` convert `val` to `lowercase`
  • `uppercase(val)` convert `val` to `UPPERCASE`
  • `ltrim(val [, delim])` left trim `val` of delim (default to spaces)
  • `rtrim(val [, delim])` right trim `val` of delim (default to spaces)
  • `trim(val [, delim])` left/right trim `val` of delim (default to spaces)
  • `sprintf(format, val1, val2, ..)` return a formatted string using `val1`, `val2`, etc.. as arguments
  • `vsprintf(format, values)` return a formatted string using `values` array as arguments
  • `uuid(namespace)` generate a `uuid` (universal unique identifier), with optional given namespace
  • `inline(tpl, [reps|data])` create or render an `inline` template referenced in 'tpl'
  • `tpl(tpl_id_string, {"var1" : val1, "var2" : val2, ..})` / `template(tpl_id_string, {"var1" : val1, "var2" : val2, ..})` CALL a subtemplate referenced by 'tpl_id', passing the necessary data
  • `pluginName([val1, val2, ..])` call a custom (user-defined) `plugin` as a template function (see examples)

Differences between include and template

The main difference is that include will actually copy the subtemplate contents inside the calling template (thus only one final template is generated). This is similar to PHP's include directive.

On the contrary tpl directive will call and parse a subtemplate on its own (so the data need to be passed also). In this case each subtemplate will be compiled on its own and exist in the cache.

When the templates are already cached, the relative performance of these directives is similar. include tends to be slightly faster since it generates only a single template, while template will generate all needed templates. However if a subtemplate has been changed and is embedded in another template using include , the calling template will __NOT__ be refreshed. While if template is used, the calling template __WILL__ be refreshed (since the subtemplate is called as a subroutine and not copied literally inside the calling template)

The syntax for include is this: include(subtemplateId)

The syntax for tpl / template is this: tpl(subtemplateId, {"var1":$value1, "var2":$value2, ..})

where the {"var1":$value1, "var2":$value2, ..} are the data to be passed to the called template this is exactly how the Contemplate.tpl(id, data) method is called.

Contemplate API

(javascript)


// create a custom dynamic context for modular use
Contemplate.createCtx('my-context');

// dispose a custom dynamic context (created earlier)
Contemplate.disposeCtx('my-context');

// Add templates
Contemplate.add({
    'tpl1': './path/to/template1',
    'tpl2': './path/to/template2',
    'inline_tpl': ['<% $var %>'], // inline template
    'dom_tpl': '#dom_tpl_id' // DOM template (for browser)
} [, ctx="global"]);

// set a custom template finder per context
// for javascript engine it should support both sync and async operation if callback 2nd argument is given
Contemplate.setTemplateFinder(function(tplId [,cb]){
} [, ctx="global"]);

// set an array of possible paths where contemplate may find templates per context (and custom templatefinder is not defined)
Contemplate.setTemplateDirs(templateDirs [, ctx="global"]);

// get the array of possible paths where contemplate may find templates per context (if set, else empty array)
Contemplate.getTemplateDirs([ctx="global"]);

// add plugins
Contemplate.addPlugin('print', function(v) {
    return '<pre>' + JSON.stringify(v, null, 4) + '</pre>';
} [, ctx="global"]);

// set cache directory for Node, make sure it exists
Contemplate.setCacheDir(path.join(__dirname, '/_tplcache') [, ctx="global"]);


// set caching mode for Node
// Contemplate.CACHE_TO_DISK_AUTOUPDATE, Contemplate.CACHE_TO_DISK_NOUPDATE, Contemplate.CACHE_TO_DISK_NONE
Contemplate.setCacheMode(Contemplate.CACHE_TO_DISK_AUTOUPDATE [, ctx="global"]);


// get a template by id, load it and cache it if needed
var tpl = Contemplate.tpl('tpl_id' [, null, options={}]);

// render template
tpl.render(data);

// render a template by id, using data, load it and cache it if needed (sync operation all engines)
Contemplate.tpl('tpl_id', data [, options]);

// Javascript-only: get or render a template by id async (promise-based), load it and cache it if needed
Contemplate.tplPromise('tpl_id', data [, options])
.then(function(tpl){
    // do something with tpl
})
.catch(function(err){
    setImeout(function() {
        throw err;
    }, 0);
});


Details

Contemplate

Light-weight, fast and flexible object-oriented template engine for PHP, Python and JavaScript (Node.js, Browser and XPCOM)

Contemplate

version: 1.6.0

The original inspiration came from an old post by John Resig (http://ejohn.org/blog/javascript-micro-templating/)

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Importer simple class &amp; dependency manager and loader for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor &amp; cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python

Contemplate

Contents

Features:

  • Uniform functionality, Engine Implementations for PHP , Python , JavaScript (NOTE `javascript` engine supports both sync and async operations both callback-based and promise-based)
  • Simple and light-weight (only one relatively small class for each implementation, no other dependencies) `~50kB` minified, `~16kB` zipped
  • Fast both in parsing and rendering. Can cache templates dynamically (filesystem caching has 3 modes, `NONE` which uses only in-memory caching, `NOUPDATE` which caches the templates only once and `AUTOUPDATE` which re-creates the cached template if original template has changed, useful for debugging)
  • Generated cached template code is formatted and annotated with comments, for easy debugging (note: `javascript` cached templates are UMD modules which can be used in both `node.js`/`AMD`/`XPCOM`/`browser`/`es6 module fallback`)
  • Syntax close to PHP (there was an effort to keep the engine syntax as close to `PHP` syntax as possible, to avoid learning another language syntax)
  • Easily extensible , configurable
  • Object-oriented, templates implement inheritance and polymorphism in a full object-oriented manner (see below)
  • Template Inheritance , templates can extend/inherit other templates using `extends` directive and override blocks using `block` , `endblock` directives (see examples)
  • Direct Super reference , templates can use the `super` template function to directly reference (and call) a super block if needed in OO manner (see examples)
  • Nested Blocks , template blocks can be nested and repeated in multiple ways (see examples)
  • Supports multiple dynamic contexts , and contextual settings so that different modules of an application can use the engine independantly (see examples and manual)
  • Date manipulation similar to `PHP` format (ie `date` function).
  • Loops can have optional `elsefor` statement when no data, or data is empty (see tests)
  • Templates can `include` other templates (similar to `PHP` `include` directive), these includes wil be compiled into the the template that called them
  • Templates can call another template using `tpl` function, these templates are called as templates subroutines and parsed by themselves
  • Custom Plugins , can be used as template functions to enhance/extend the engine functionality (see examples)
  • Support for literal PHP/JS/PY code. Literal php or javascript or python code can be included as is (properly indented) and will be merged into the compiled output (see examples). Same template can include literal code in all supported languages, only the code relevant to the current engine will actually be compiled and used.

Dependencies

  • Only 3 classes are used (`Contemplate.php`, `Contemplate.js`, `Contemplate.py`), no other dependencies
  • `PHP` `5.2+` supported
  • `Node` `0.8+` supported
  • `Python` `2.x` or `3.x` supported
  • all browsers
  • `Contemplate` is also a `XPCOM JavaScript Component` (Firefox) (e.g to be used in firefox browser addons/plugins for templating)

Performance

Note: The engines included in the following tests have different philosophy and in general provide different features. These are only illustrative modulo all the other features.

Render Time

The following tests were made on a revision of a 2013 jsperf test for resig micro-templating, handlebars, contemplate, mustache, underscore, doT and kendoui template engines.

Previous tests are here jsperf/0.6.5, jsperf/0.6.7, jsperf/0.7, jsperf/0.7.1, jsperf/0.8, jsperf/0.8.1, jsperf/1.0.0, jsperf/1.0.0 (1.0.0+ format)

Contemplate has consistently top performance on all browsers.

contemplate rendering jsperf

Parse / Compilation Time

The following tests involve swig, handlebars, contemplate and mustache template engines.

Previous tests are here jsperf/0.6.7, jsperf/0.7, jsperf/0.7.1, jsperf/0.8, jsperf/0.8.1, jsperf/1.0.0

Contemplate has consistently top performance on all browsers.

contemplate parse jsperf


  Live DemoExternal page  

Open in a separate window

Screenshots  
  • screenshots/contemplate-interactive.png
  • screenshots/contemplate.jpg
  • screenshots/jsperf-compilation.png
  • screenshots/jsperf-rendering.png
  • screenshots/template_data.png
  • screenshots/template_markup.png
  • screenshots/template_output.png
  Files folder image Files  
File Role Description
Files folder imagesrc (4 directories)
Files folder imagetest (8 directories)
Accessible without login Plain text file changelog.md Data Auxiliary data
Accessible without login Plain text file manual.md Doc. Documentation manual
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagegrammar (1 file)
Files folder imagejs (2 files, 1 directory)
Files folder imagephp (1 file, 1 directory)
Files folder imagepython (2 files, 1 directory)

  Files folder image Files  /  src  /  grammar  
File Role Description
  Accessible without login Plain text file contemplate.js Data Auxiliary data

  Files folder image Files  /  src  /  js  
File Role Description
Files folder imageplugins (1 file)
  Accessible without login Plain text file Contemplate.js Data Auxiliary data
  Accessible without login Plain text file Contemplate.min.js Data Auxiliary data

  Files folder image Files  /  src  /  js  /  plugins  
File Role Description
  Accessible without login Plain text file plugins.txt Doc. Documentation

  Files folder image Files  /  src  /  php  
File Role Description
Files folder imageplugins (1 file)
  Plain text file Contemplate.php Class Class source

  Files folder image Files  /  src  /  php  /  plugins  
File Role Description
  Accessible without login Plain text file plugins.txt Doc. Documentation

  Files folder image Files  /  src  /  python  
File Role Description
Files folder imageplugins (2 files)
  Accessible without login Plain text file Contemplate.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  src  /  python  /  plugins  
File Role Description
  Accessible without login Plain text file plugins.txt Doc. Documentation
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  
File Role Description
Files folder image01-inheritance (19 files)
Files folder image02-contexts (29 files)
Files folder image03-literal-code (15 files)
Files folder image04-functions (6 files)
Files folder image05-asynchronous (1 file, 2 directories)
Files folder image06-variables (12 files)
Files folder image07-folders (4 files, 2 directories)
Files folder image08-web (3 files, 3 directories)

  Files folder image Files  /  test  /  01-inheritance  
File Role Description
  Accessible without login Plain text file out-js.txt Doc. Documentation
  Accessible without login Plain text file out-php.txt Doc. Documentation
  Accessible without login Plain text file out-py.txt Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data
  Accessible without login HTML file tpl1.html Doc. Documentation
  Accessible without login Plain text file tpl1_tpl__global.js Data Auxiliary data
  Plain text file tpl1_tpl__global.php Class Class source
  Accessible without login Plain text file tpl1_tpl__global.py Data Auxiliary data
  Accessible without login HTML file tpl2.html Doc. Documentation
  Accessible without login Plain text file tpl2_tpl__global.js Data Auxiliary data
  Plain text file tpl2_tpl__global.php Class Class source
  Accessible without login Plain text file tpl2_tpl__global.py Data Auxiliary data
  Accessible without login HTML file tpl3.html Doc. Documentation
  Accessible without login Plain text file tpl3_tpl__global.js Data Auxiliary data
  Plain text file tpl3_tpl__global.php Class Class source
  Accessible without login Plain text file tpl3_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  /  02-contexts  
File Role Description
  Accessible without login HTML file global.html Doc. Documentation
  Accessible without login Plain text file global_tpl__ctx1.js Data Auxiliary data
  Plain text file global_tpl__ctx1.php Class Class source
  Accessible without login Plain text file global_tpl__ctx1.py Data Auxiliary data
  Accessible without login Plain text file global_tpl__ctx2.js Data Auxiliary data
  Plain text file global_tpl__ctx2.php Class Class source
  Accessible without login Plain text file global_tpl__ctx2.py Data Auxiliary data
  Accessible without login Plain text file global_tpl__ctx3.js Data Auxiliary data
  Plain text file global_tpl__ctx3.php Class Class source
  Accessible without login Plain text file global_tpl__ctx3.py Data Auxiliary data
  Accessible without login Plain text file out-js.txt Doc. Documentation
  Accessible without login Plain text file out-php.txt Doc. Documentation
  Accessible without login Plain text file out-py.txt Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data
  Accessible without login HTML file tpl1.html Doc. Documentation
  Accessible without login HTML file tpl2.html Doc. Documentation
  Accessible without login HTML file tpl3.html Doc. Documentation
  Accessible without login Plain text file tpl_tpl__ctx1.js Data Auxiliary data
  Plain text file tpl_tpl__ctx1.php Class Class source
  Accessible without login Plain text file tpl_tpl__ctx1.py Data Auxiliary data
  Accessible without login Plain text file tpl_tpl__ctx2.js Data Auxiliary data
  Plain text file tpl_tpl__ctx2.php Class Class source
  Accessible without login Plain text file tpl_tpl__ctx2.py Data Auxiliary data
  Accessible without login Plain text file tpl_tpl__ctx3.js Data Auxiliary data
  Plain text file tpl_tpl__ctx3.php Class Class source
  Accessible without login Plain text file tpl_tpl__ctx3.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  /  03-literal-code  
File Role Description
  Accessible without login Plain text file out-js.txt Doc. Documentation
  Accessible without login Plain text file out-php.txt Doc. Documentation
  Accessible without login Plain text file out-py.txt Doc. Documentation
  Accessible without login HTML file reserved.html Doc. Documentation
  Accessible without login Plain text file reserved.js Data Auxiliary data
  Accessible without login Plain text file reserved.php Aux. Auxiliary script
  Accessible without login Plain text file reserved.py Data Auxiliary data
  Accessible without login HTML file test.html Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data
  Accessible without login Plain text file test_tpl__global.js Data Auxiliary data
  Plain text file test_tpl__global.php Class Class source
  Accessible without login Plain text file test_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  /  04-functions  
File Role Description
  Accessible without login Plain text file out-js.txt Doc. Documentation
  Accessible without login Plain text file out-php.txt Doc. Documentation
  Accessible without login Plain text file out-py.txt Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data

  Files folder image Files  /  test  /  05-asynchronous  
File Role Description
Files folder image_tplcache (1 file, 2 directories)
Files folder image_tpls (1 file, 3 directories)
  Accessible without login Plain text file test.js Data Auxiliary data

  Files folder image Files  /  test  /  05-asynchronous  /  _tplcache  
File Role Description
Files folder imagecommon (2 files)
Files folder imagelayout (1 file)
  Accessible without login Plain text file demo_tpl_html_tpl__global.js Data Auxiliary data

  Files folder image Files  /  test  /  05-asynchronous  /  _tplcache  /  common  
File Role Description
  Accessible without login Plain text file bar_tpl_html_tpl__global.js Data Auxiliary data
  Accessible without login Plain text file foo_tpl_html_tpl__global.js Data Auxiliary data

  Files folder image Files  /  test  /  05-asynchronous  /  _tplcache  /  layout  
File Role Description
  Accessible without login Plain text file base_tpl_html_tpl__global.js Data Auxiliary data

  Files folder image Files  /  test  /  05-asynchronous  /  _tpls  
File Role Description
Files folder imagecommon (2 files)
Files folder imageinclude (1 file)
Files folder imagelayout (1 file)
  Accessible without login HTML file demo.tpl.html Doc. Documentation

  Files folder image Files  /  test  /  05-asynchronous  /  _tpls  /  common  
File Role Description
  Accessible without login HTML file bar.tpl.html Doc. Documentation
  Accessible without login HTML file foo.tpl.html Doc. Documentation

  Files folder image Files  /  test  /  05-asynchronous  /  _tpls  /  include  
File Role Description
  Accessible without login HTML file sub.tpl.html Doc. Documentation

  Files folder image Files  /  test  /  05-asynchronous  /  _tpls  /  layout  
File Role Description
  Accessible without login HTML file base.tpl.html Doc. Documentation

  Files folder image Files  /  test  /  06-variables  
File Role Description
  Plain text file dynamic_method_call.php Class Class source
  Accessible without login Plain text file out-js.txt Doc. Documentation
  Accessible without login Plain text file out-php.txt Doc. Documentation
  Accessible without login Plain text file out-py.txt Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Plain text file test.php Class Class source
  Accessible without login Plain text file test.py Data Auxiliary data
  Accessible without login HTML file test.tpl.html Doc. Documentation
  Accessible without login Plain text file test_tpl__global.js Data Auxiliary data
  Plain text file test_tpl__global.php Class Class source
  Accessible without login Plain text file test_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  /  07-folders  
File Role Description
Files folder imagefolder1 (1 directory)
Files folder imagefolder2 (1 file)
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data
  Accessible without login HTML file tpl.html Doc. Documentation

  Files folder image Files  /  test  /  07-folders  /  folder1  
File Role Description
Files folder imagesubfolder1 (1 file)

  Files folder image Files  /  test  /  07-folders  /  folder1  /  subfolder1  
File Role Description
  Accessible without login HTML file tpl1.html Doc. Documentation

  Files folder image Files  /  test  /  07-folders  /  folder2  
File Role Description
  Accessible without login HTML file tpl2.html Doc. Documentation

  Files folder image Files  /  test  /  08-web  
File Role Description
Files folder imagejs (1 file)
Files folder image_tplcache (13 files)
Files folder image_tpls (5 files)
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file test.py Data Auxiliary data

  Files folder image Files  /  test  /  08-web  /  js  
File Role Description
  Accessible without login Plain text file Contemplate.min.js Data Auxiliary data

  Files folder image Files  /  test  /  08-web  /  _tplcache  
File Role Description
  Accessible without login Plain text file base_tpl__global.js Data Auxiliary data
  Plain text file base_tpl__global.php Class Class source
  Accessible without login Plain text file base_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file demo_tpl__global.js Data Auxiliary data
  Plain text file demo_tpl__global.php Class Class source
  Accessible without login Plain text file demo_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file main_tpl__global.js Data Auxiliary data
  Plain text file main_tpl__global.php Class Class source
  Accessible without login Plain text file main_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file sub_tpl__global.js Data Auxiliary data
  Plain text file sub_tpl__global.php Class Class source
  Accessible without login Plain text file sub_tpl__global.py Data Auxiliary data
  Accessible without login Plain text file __init__.py Data Auxiliary data

  Files folder image Files  /  test  /  08-web  /  _tpls  
File Role Description
  Accessible without login HTML file base.tpl.html Doc. Documentation
  Accessible without login HTML file date.tpl.html Doc. Documentation
  Accessible without login HTML file demo.tpl.html Doc. Documentation
  Accessible without login HTML file main.tpl.html Doc. Documentation
  Accessible without login HTML file sub.tpl.html Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:84
This week:1
All time:10,019
This week:560Up