Closed joshpangell closed 11 years ago
Related to issue #2, loops do not work in conditionals.
The first proposed fix for the if else issue in commit 600215d actually does work, however the most recent fix in commit b9b6383 does not.
if
else
Example:
$h = new Handlebars_Engine; echo $h->render( '<div class="entry"> {{#if author}} {{#author}}<h1>{{firstName}} {{lastName}}</h1>{{/author}} {{else}} <h1>Unknown Author</h1> {{/if}} </div> ', array( 'author' => array( array( 'firstName' => "Nikola", 'lastName' => "Tesla" ), array( 'firstName' => "Carl", 'lastName' => "Segan" ), array( 'firstName' => "Neil", 'lastName' => "Degrasse Tyson" ) ) ) );
The latest commit, b9b6383, will render incorrectly
<div class="entry"> <h1>Nikola Tesla</h1> </div>
Commit 600215d will render correctly
<div class="entry"> <h1>Nikola Tesla</h1> <h1>Carl Segan</h1> <h1>Neil Degrasse Tyson</h1> </div>
thanks for the report @joshpangell.
Related to issue #2, loops do not work in conditionals.
The first proposed fix for the
if
else
issue in commit 600215d actually does work, however the most recent fix in commit b9b6383 does not.Example:
The latest commit, b9b6383, will render incorrectly
Commit 600215d will render correctly