-
Notifications
You must be signed in to change notification settings - Fork 27
Function_plugin
miroshnikov edited this page Mar 27, 2015
·
1 revision
All attributes passed to template functions from the template are contained in the params
object.
data
is an object passed to fetch().
- Register plugin
jSmart.prototype.registerPlugin(
'function',
'sayHello',
function(params, data)
{
var s = 'Hello ';
if ('to' in params)
{
s += params['to'];
}
return s;
}
);
- Use in the template
{sayHello to='Everybody'}
- The result would be
Hello Everybody