|  Download ChangeLog__1.6.0__
* define local variables that are literally accessible to literal code and vice-versa
* variable parsing became better, can use any valid expression in variable bracket
* update tests __1.5.0__
* support including literal php/js/py code (properly indented), see examples and manual
* stop compatibility mode support
* drop localization support (user should include her own solution as plugins)
* major refactor, some utility methods renamed (eg url -> urlencode) or removed (eg data, ucfirst/lcfirst, camelcase/snakecase, addslashes/stripslashes)
* update tests __1.4.0__
* support php-like object accesss notation (arrow notation->) to support not only strictly arrays as template data but arbitrary objects as well. Support arbitrary chained prop/method access (works same for all js/php/python engines)
* addgettemplate directive to access arbitrary (nested) variable properties based on arbitrary expressions (arbitrary expressions not supported by literal object access notation above, see manual) and also access dynamic properties that usegettermethods
* add new template functionskeys(php-likearray_keys),values(php-likearray_values),buildquery(php-likehttp_build_query),parsequery(php-likeparse_str)
* update tests and live examples along with contemplate grammar __1.3.0__
* PHP/JS/PY: support custom template finder per context or even an array of possible template dirs in order to find templates dynamicaly not already added/defined (js engine supports both sync and async operations plus promise-based) (see manual for details)
* PHP/JS/PY: add template function vsprintfsimilar tosprintfbut accepts an array of arguments instead of them being passed individualy as separate arguments during function call (can be useful when needing to format string based on arguments from data or parameters)
PY: try to implementsprintf/vsprintffunctionality as close as possible to originalphp/jssprintf/vsprintf(uses old-style string formating with a couple of hacks, maybe in future use new-style.formatmethod)
JS: fix and complete async template loading, parsing and rendering (fix a small issue with async parsing not updating regex) and also dostatic analysis(during compilation) on dynamic templates used inside calling template (ie usingtpl/templatefunctions) andpre-load them async* (if in async opreation) in order to be rendered without blocking. If sync operations, everything functions as before
PHP: handle dynamic function creation (eg for inline templates) forPHP < 7.2.0andPHP >= 7.2.0wherecreate_functionis deprecated __1.2.5__
JS: enable asynchronous template loading, parsing and writing so that performance can be even greater in Node.jswheresyncmethods may block.Contemplate.tpl,Contemplate.getTemplateContents,Contemplate.parseTplall accept acallback(nodeback) as last argument with signaturefunction(err, result)which if given all processing becomesasynchronous. Also ifPromisesare supported"promisified"* versions of the above methods exist i.eContemplate.tplPromise,Contemplate.getTemplateContentsPromise,Contemplate.parseTplPromiseall return aPromisewhich resolves and rejects accordingly.
* PHP/PY: update versions __1.2.0__
* PHP/JS/PY: enable templates subfolders and paths. Meaning a template id can have relative path in its name and same relative path will be created and mirrored in template cacheDir and served as such. This accomodates templates used for different purposes having same basename but differing in relative path and also reflects structure and organisation of original templates. This resolves the issue and also allows more flexibility in handling many different templates and template folder structures. If path does not exist in cache folder it will be created automaticaly.
* add new template function queryvarto add/removeurl queryvariables from givenurl(needed sometimes in templates)
* add new template functionstriptagsto striphtml tagsfrom string
* add custompluralFormcallable (per context) for current locale. It specifies whether asingularorpluralstring is to be used based on numeric value given (eg a-la wordpress) (see manual how to set or clear)
*locale/xlocalemethods slightly changed signature and can accept an optionalarray/listof arguments which will be used to format the string to be localised a-lasprintffunctionality (done automaticaly) (NOTE: limitedsprintfsupport for python implementation)
* JS/PY:emptyfunction behaves now exactly like PHP's function, ie it returnstruealso for string with value"0" __1.1.10__
* PHP: require exclusive lock when writing a compiled and cached template to disk
* PY: make sure module is reloaded in case it is out of date when loading a template (as module) from disk. Seems to fix the failure to load/import template module if created just before loading
* JS: update version __1.1.9__
* PHP: use class_exists($class, false), JS/PY: update version numbers __1.1.8__
* create_functionis deprecated in PHP 7.2+, so eliminate use ofcreate_functionand use with@operator to avoid php notices. It is not used but left there for compatibility. Maybe removed completely in another update __1.1.7__
* minor changes for better code alignment/indentation
* minor changes in rendering __1.1.6__
* minor changes for faster basic templates
* new function join / jto (flatly) string-concatenate arbitrary array (of arrays) with given separator __1.1.5__
* new function in_arrayto test if array contains a value (similar to php)
* new functionsjson_encode,json_decode(similar to php) __1.1.4__
* lazier init for faster performance
* new function is_arrayto test both if isarray(strict) or isobjectnew directivelocal_setto set/update alocal* variable
* some further optimisation changes __1.1.3__
* add continueandbreakloop constructs/directives
* minor changes __1.1.2__
* iifis a templatedirectiveinstead of afunction, so it functions exactly asinlined ternary-ifstatement
*emptyis a templatedirectiveinstead of afunction, so it functions exactly as php'semptydirective
* inline, at compile-time, more template functions (e.gconcat) for faster execution
* inlined plugins can receive passed arguments (via$array parameter) both as (comma-separated) string ($0), plus each separate argument ($1..$n)
* lazy init and rendering for inline templates and plugins for even faster execution
* removepluralfunctions and add linguisticaly contexual localisationxlocale,nxlocalefunctions
*ccfunction alias ofconcat* fix php-likedate()function in python implementation (wrong day of week forSunday) __1.1.1__
* plugins (non-inlined) with empty arguments invalid output code generation, fixed
* localisation settings accept a callback function as well for custom dynamic localisation (with optional extra arguments)
* new localisation function nlocalefor singular/plural dynamic localisation based on numeric parameter (1st argument) __1.1.0__
* inline iffunctioniif()* php-likeempty()function
* fixdate()function in python implementation (wrong month,day of week)
* fixnot,or,andoperator replacements in python implementation
* minor changes __1.0.0__
enable multiple dynamic contexts (see examples), different parts of an application can use the engine in amodular way, with their contextual template settings (including templates, caching, directories, locales, plugins, etc..)independantly*
template directives,functionsandpluginsno longer use* the%prefix i.e%for,%if, .. butfor,if, .. if compatibility to older format is needed useContemplate.setCompatibilityMode( true )elifalias ofelseif,fialias of*endif* optimisations, typo fixes __0.9.2__
* update/optimise date,localized_datemethods
* remove%html(htmlentities) method (not needed, can be added as plugin if needed, less code size)
*ContemplateInlineTplminor changes __0.9.1__
* make %super(block)a construct (cannot be overriden via a plugin)
* add%getblock(block)construct to return block content directly via function, can be useful when block content is needed as a parameter
*%blockconstruct can be defined without being echoed (like a container) using%block(blockID, false)* can override 'cacheDir' option inContemplate.tplcall via options (experimental) __0.9.0.1__
* add hasTpl(tpl),hasPlugin(name)Contemplate methods __0.9__
* make %htmltable,%htmlselectexternal plugins (reduce main engine code size etc)
* add%supertemplate function to reference a super block directly if needed in OO manner
* defined plugins no longer take aplg_prefix, the plugin name is exactly same as the given name defined (this way even built-in functions can be overriden in some cases) __0.8.4__
* inlined plugins replace code accept the plugin arguments as well
* fix subsequent plugin calls in templates, are not parsed/rendered correctly (php) __0.8.3__
* refined BlockTag parsing (accurately parse blockTag, regardless of strings)
* test examples provide a Contemplate tutorial, API reference as well __0.8.2.1__
* Contemplate.js remove Function.binddependency
* tag new version __0.8.2__
* InlineTemplate.multisplit_remethod, split inlineTpl using regexps
* Contemplate.php fixundefined __currentblockerror
* minor changes __0.8.1__
* even faster rendering optimisations (esp. for javascript, reduce rendering function calls by one)
* minor changes __0.8__
* new template function %echo(similar to php function that echoes strings to the output)
*%tpl(alias of%template,%templateto be deprecated?)
*%tpl,%template,%include,%extends,%blockconstructs/functions accept literal strings as (1st) argument (see examples)
* minor edits
* various optimisations, faster, more refined compilation and rendering __0.7.1__
* handle loop variables as local (block-scoped) variables (not added or accessed to/from passed data)
* various optimisations
* (re-uploaded) fix inline templates rendering issue __0.7__
* inline templates both in Contemplate templates (e.g as parameters to other functions) or in code
* %inlinetemplate function, creates/renders inline templates
* templates classes extendContemplate.Tpltemplate class (Contemplate.InlineTplalso?)
* minor updates __0.6.12__
* python-style for-loops contructs (see manual and examples) __0.6.11__
* remove Contemplate.addInlinemethod,Contemplate.addhandles both references and literal/inline templates
* minor changes/updates __0.6.10__
* optimise custom html esc method (Contemplate.js) __0.6.9__
* enable plugin code inlining inside the compiled template
* add a custom simpler/faster html escape function %e* minimise plugin naming convention (%plugin_pluginName,%plg_pluginName)
* add html entinties escape mode as parameter (default="ENT_COMPAT")
* optimisehtmlentities,countetc. methods from phpjs (Contemplate.js) __0.6.8__
* option to create a template instance from pre-parsed template code returned from Contemplate.parseTplmethod
* minor changes __0.6.7__
* make parse method public as Contemplate.parseTpl( tpl, options ) __0.6.6__
* remove render data initialisation/copy/isolation code from inside tpl.render methods (makes rendering a lot faster), user can copy data (once) using Contemplate.datamethod if needed as needed
* minor edits/optimizations (e.g in loops) __0.6.5__
* enable associative and non-associative forloops (see examples) i.efor(o as k=>v)for(o as v)* minor edits/optimizations __0.6.4__
* make faster and more precise (internal) template parsing/rendering
* make faster and more precise blocks and nested block parsing
Contemplate for Node.js isnot* global anymore
* refactor/optimize __0.6.3__
* add more options (e.g 'autoUpdate') per single template
* fix some typos __0.6.2__
* parse nested blocks
* escapeparse option (true by default), options syntax change (see manual) __0.6.1__
enable template separators to be definedinsidea template or passed asparamaters* __0.6__
* define template separators in the 1st line of a template (each tpl can define its own separators)
* micro edits/changes __0.5.3, 0.5.4__
* add %issetdirective
* change%has_keytemplate function to%haskey* template directives parsing edits (accomodate nested directives in arguments) __0.5.2__
* enable literal data to be used as a loop object (see examples)
* php data func (deep object) fixed __0.5.1__
* add %addslashes,%stripslashestpl functions
* updates / edits __0.5__
* add support for custom (user-defined) plugins as template functions with addPlugin(name, handler) method
* add support for setting/unsetting custom variables inside template (on-the-fly) with %set(var, val),%unset(var)directives
* refine/optimize template parsing for strings and variables
* support literal data notation with template functions and plugins also
* updates / edits __0.4.10__
* add custom codePrefix in cached templates __0.4.9__
* add %uuidfunction (generate universal unique id) __0.4.8__
* change %pluralisesignature, unifyContemplate.add,Contemplate.addInlinemethods, edits, optimizations __0.4.7__
* add %pluralisefunction,clearLocaleStrings,setPlurals,clearPluralsmethods __0.4.6__
* add %lowercase,%uppercase,%camelcase,%snakecasetemplate functions (see manual) __0.4.5__
* add %has_keytemplate function (see manual) __0.4.4__
* escape single quotes and parse template variables accurately __0.4.3__
* Contemplate Engine for Python 2.x and 3.x
* minor edits, generate formatted and anotated cached template code (better for debug)
* tidy up repo
* project stopped __0.4.2__
* add clear (memory) method clearCache()* allow inline templates withaddInline()method (see examples)
* allowfor()directive to handle an expression in place of an object ( so%for($data["subdata"] as $key=>$val)or other expressions WILL work)
* allow to refresh the (memory) cache for a specific template (ie.Contemplate.tpl(tpl_id, data, refresh))refresh = truewill refresh the (memory) cache (defaultfalse) __0.4.1__
* parse template tags a little more accurately
* minor edits/optimizations __0.4__
* add template inheritance and block definitions
* allow client-js template engine to load templates via ajax
* add basic html/url escaping ( htmlentities,urlencode)
* minor edits/optimizations __0.3.3__
* make Contemplate.js work with Nodejs , add nodejs server example (test.js)
* add %countfunction (number of items in an array/object) __0.3.2__
* make %htmltable%htmlselectconstructs instead of functions (so literal data can be used also)
* add%ltrim,%rtrimfunctions
* minor fixes, edits __0.3.1__
* add %q%dqfunctions (quote, double quote)
* add%htmltable%htmlselectfunctions (render a html table with options, render a html select with options)
* minor fixes, edits __0.3__
* add %templatedirective
* add template functions to manipulate dates and localized dates
* add some javascript methods from phpjs project, (trim,sprintf,time,date), these are available as template functions (eg%sprintf,%trim, etc..)
* make the Contemplate.js class compatible with both browser, node.js and requirejs configurations __0.2__
* add %includedirective
* make template separators configurable (defaults are<%and%>)
* add filesystem caching, refactor, optimize __0.1__
* add localization options and template functions
* initial release |