Hi Dan
> Can you assign the template after the jSmart object is created?
> Can you use assign to add data to the template?
Not exactly, but you can do something like this:
var test = new jSmart(testTpl); //the template is compiled now
var data = {
'key' : 'value'
};
var res1 = test.fetch(data); //it's cheap to call fetch() many
times since the template has been compiled already
data['key'] = 'another_value';
var res2 = test.fetch(data);
>Also I'll probably look to do template inheritance (
http://www.smarty.net/inheritance) is this on your radar?
Inheritance is supported in the current version:
var test = new jSmart(parentTpl, childTpl, grandChildTpl, ...);
use {block} in child templates just like it's described here:
http://www.smarty.net/docs/en/language.function.block.tpl
{extends} is not supported since there is no need for it
BUT there is one feature that the current version of jSmart completely
misses - variable modifiers
I hope a new version with support of modifiers will be out soon
Max
On Apr 18, 1:09 pm, Dan <
webmas...@d2g.org.uk> wrote:
> Hi Max,
>
> Just a few questions.
>
> Can you assign the template after the jSmart object is created?
> Can you use assign to add data to the template?
>
> So using smarty I can do:
>
> $test = new smarty();
> $test->assign('key',$value);
> $test->fetch("test.tpl");
>
> Also I'll probably look to do template inheritance (
http://www.smarty.net/inheritance) is this on your radar?
>
> My Javascript is ok but I'm quite heavily reliant on 3rd party JS.
> What I expect I'll try to do is to extend the jsmart object (usinghttp://
javascriptmvc.com/docs.html#&who=jQuery.Class) and wrap JQuery