Closed jslegers closed 9 years ago
@jslegers, the syntax, you proposed, is not compatible with Handlebars.js. I think there is no reason to implement a new complex arguments passing syntax. It is a step away from compatibility between PHP and JS versions of Handlebars.
@JustBlackBird :
That's a totally valid point.
I guess this issue should be raised at the handlebars.js
community, so I did -> https://github.com/wycats/handlebars.js/issues/817
as main implementation rejected this proposal, I am closing this one too.
I'm currently experimenting with the following features.
Sub-templating
Syntax :
Explanation :
panel
at this very spot{{this}}
and{{name}}
to the templatePassing data to helpers
The problem with the syntax
{{{template panel this name}}}
is that it's rather restrictive in naming of parameters that are past to a subtemplate (or other helper).To allow more custom naming, alternate syntaxes could be :
See also https://github.com/XaminProject/handlebars.php/pull/44
The problem with these syntaxes, is distinguishing between what content should passed literally (eg.
John
) and what content should passed as a reference (eg.this
). Variations on this syntax that add this distinction would be :As any content in between a beginning and end tag remains unparsed for custom helpers, there are nevertheless still many alternatives worth considering :
Would you be interested in adding any of these syntaxes to the
XaminProject/handlebars.php
library? I am still considering which syntax to use for my ownPowerTools
project and I figured I might as well contribute the syntax I eventually choose to theXaminProject/handlebars.php
project if anyone is interested.EDIT :
See also https://github.com/wycats/handlebars.js/issues/817