jsmart
jsmart copied to clipboard
JavaScript template engine, port of the PHP template engine Smarty to Javascript, lets you use the same templates for PHP and JavaScript, on both server and client-side.
Template axample: "{if $info = "test"}{$info}{/if}" Expected result: "test" Actual result: empty string, no execution of code inside the "if" block.
https://jsfiddle.net/miroshnikov/6tfz9p3z/1/ This line (27) doesn't work: `var res = document.getElementById('test_tpl').innerHTML.fetch(data);` In console: ``` VM78:75 Uncaught TypeError: document.getElementById(...).innerHTML.fetch is not a function at window.onload (VM78:75) ``` When commented out, the demo...
var s = 111; function isset(v){ return typeof v != 'undefined' } console.log( isset(s) ) // **TRUE** var compiled = new jSmart( '{if isset($a) && $a==$b}1{else}2{/if}' ); // **1** //...
``` What steps will reproduce the problem? jSmart example {if isset($undefinedVar)} Variable is defined. {else} Variable is not defined. {/if} function isset(val) { return (typeof val !== 'undefined'); } var...
``` What steps will reproduce the problem? 1. var tpl = new jSmart("{if $booleanFalse === false}OK{else}WRONG{/if}"); 2. tpl.fetch({'booleanFlase':false}); 3. What is the expected output? What do you see instead? Expect:...
``` What steps will reproduce the problem? Execute: new jSmart('{1 === true}').fetch() What is the expected output? What do you see instead? Should return false, but instead a get error...
``` What steps will reproduce the problem? 1. Try to output : "août"|capitalize What is the expected output? What do you see instead? Expected : Août Instead of : AoÛT...
``` http://code.google.com/p/jsmart/wiki/caching the caching method is great, but only in browser. I want to use jSmart in my asp project, using the code : >>> var name = xxxx; var...