Lines Matching defs:each

247 {{#each posts}}
250 {{/each}}
306 You can iterate over a list using the built-in each helper. Inside the block, you can use {{this}} or {{.}} to reference the element being iterated over.
312 {{#each genres}}
314 {{/each}}
317 {{#each cars}}
321 {{#each list}}
323 {{/each}}
325 {{/each}}
370 {{#each genres}}
374 {{/each}}
379 The #each helper (php only) also has the ability to slice the data
381 * {{#each Array[start:end]}} = starts at start through end -1
382 * {{#each Array[start:]}} = Starts at start though the rest of the array
383 * {{#each Array[:end]}} = Starts at the beginning through end -1
384 * {{#each Array[:]}} = A copy of the whole array
385 * {{#each Array[-1]}}
386 * {{#each Array[-2:]}} = Last two items
387 * {{#each Array[:-2]}} = Everything except last two items
391 {{#each genres[0:10]}}
395 {{/each}}
400 When looping through items in each, you can optionally reference the current loop index via {{@index}}
403 {{#each array}}
405 {{/each}}
408 {{#each object}}
410 {{/each}}
443 {{#each genres}}
445 {{/each}}
475 {{#each genres[0:10]}}
479 {{/each}}
485 {{#each genres}}
487 {{/each}}
523 To capitalize each words in a string
568 {{#each cars}}
570 {{/each}}
575 {{#each cars}}
577 {{/each}}
678 ## Data Variables for #each
680 In Handlebars JS v1.1, data variables `@first` and `@last` were added for the #each helper. Due to the these variables
696 {{#each data}}{{#if @first}}FIRST: {{/if}}{{this}}<br>{{/each}}
708 {{#each data}}{{@first}}: {{this}}<br>{{/each}}
715 Data variables also support relative referencing within multiple #each statements.
718 {{#each data}}{{#each this}}outer: {{@../first}},inner: {{@first}};{{/each}}{{/each}}
735 {{#each objects}}{{@first}}, {{@last}}, {{@index}}, {{@unknown}}{{/each}}