XaminProject / handlebars.php

Handlebars processor for php
331 stars 134 forks source link

Add "else" block to "each" helper #40

Closed JustBlackBird closed 10 years ago

JustBlackBird commented 10 years ago

I've added "else" block to "each" helper as in JavaScript version of Handlebars. One can use the following in templates:

{{#each items}}
   {{this}}
{{else}}
   There are no items. Sorry.
{{/unless}}
everplays commented 10 years ago

Hmm, ok then. I asked it because the previous PR that had else implemented for foreach didn't do anything with stack (at least as far as I remember).

everplays commented 10 years ago

Thanks.

JustBlackBird commented 10 years ago

We are welcome.

I've try to find PR with foreach you are talking about but cannot find it. Could you please share a link to it?

everplays commented 10 years ago

sure, #33.