conditional on last item in array using handlebars.js template

Since Handlebars 1.1.0, first and last has become native to the each helper. See ticket #483.

The usage is like Eberanov’s helper class:

{{#each foo}}
    <div class="{{#if @first}}first{{/if}}{{#if @last}} last{{/if}}">{{@key}} - {{@index}}</div>
{{/each}}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)