XaminProject / handlebars.php

Handlebars processor for php
331 stars 132 forks source link

Added support for @index in #each-helper when used on lists. #26

Closed boukeversteegh closed 10 years ago

boukeversteegh commented 10 years ago

You're welcome. Thanks for the quick merge!

I've now added support for @index when iterating over lists using #each. When you use #each on an object, you can use @key to access the key, and when you iterate over a list, you can use @index to get the index. Although it is a bit annoying to think about it when you are writing the template, it is consistent with the documentation and Handlebars.js.

everplays commented 10 years ago

Thanks (again) @boukeversteegh.