Closed nonnenmacher closed 10 years ago
Actually, compatibility with handlebars.js is a work in progress so there
might be features that don't exist in php port because no one needed them
so far, @first
and @last
are among them. You can implement them
yourself and make a PR :)
P.S. have a look at implementation of @index
or @key
, they should help
you out.
On Feb 4, 2014 4:05 PM, "Vincent Nonnenmacher" notifications@github.com
wrote:
in the handlebars.js reference, there is a paragraph on automatic variables available in the each context.
"The first and last steps of iteration are noted via the @firsthttps://github.com/firstand @last https://github.com/last variables then iterating over an array. When iterating over an object only the @first https://github.com/firstis available."
I don't see support for those two variables in the source, is this planed or did I miss them ?
— Reply to this email directly or view it on GitHubhttps://github.com/XaminProject/handlebars.php/issues/46 .
It's implemented in #51, so I'm closing it.
in the handlebars.js reference, there is a paragraph on automatic variables available in the each context.
"The first and last steps of iteration are noted via the @first and @last variables when iterating over a array. When iterating over an object only the @first is available."
I don't see support for those two variables in the source, is this planed or did I miss them ?