{"issue":{"created_at":"2011-11-04T14:42:51Z","state":"open","updated_at":"2011-12-13T21:53:23Z","comments":1,"user":{"gravatar_id":"9b0f55b4081c1e05b3cbdfcbb6306c99","id":415925,"url":"https://api.github.com/users/vojtech-dobes","login":"vojtech-dobes","avatar_url":"https://secure.gravatar.com/avatar/9b0f55b4081c1e05b3cbdfcbb6306c99?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"It is not possible to use `{else}` branch in `{if}` block with condition in closing tag, because opening tag includes only `ob_start()`. I suppose using `{else}` is useful feature and quite common need, but now the only way is via using `$iterations` variable in extra `{if}` to create such branch, which is kind of magic.\r\n\r\nWith this fix it is possible to write code like this:\r\n\r\n```php\r\n{if}\r\n\t{foreach $posts as $post}\r\n\t\t{$post->title}\r\n\t{/foreach}\r\n{else}\r\n\tNo posts.\r\n{/if $iterations}\r\n```","assignee":null,"id":2144439,"labels":[],"number":392,"pull_request":{"patch_url":"https://github.com/nette/nette/pull/392.patch","html_url":"https://github.com/nette/nette/pull/392","diff_url":"https://github.com/nette/nette/pull/392.diff"},"title":"Latte: support for {else} in {if} with condition in closing tag","closed_at":null,"html_url":"https://github.com/nette/nette/issues/392","url":"https://api.github.com/repos/nette/nette/issues/392","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T21:53:23Z","updated_at":"2011-12-13T21:53:23Z","user":{"gravatar_id":"583bcf76466286a687368ef66a21e5cd","id":194960,"url":"https://api.github.com/users/dg","login":"dg","avatar_url":"https://secure.gravatar.com/avatar/583bcf76466286a687368ef66a21e5cd?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I do not like the patch: $ifNodes is unnecessary, because all nodes have $parentNode.","id":3130799,"url":"https://api.github.com/repos/nette/nette/issues/comments/3130799"}}