SE7ENSKY / jade2php

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered.
43 stars 10 forks source link

How to implement PHP foreach loop? #29

Closed OnkelTem closed 9 years ago

OnkelTem commented 9 years ago

Having this PHP code in original template:

<?php foreach ($fields as $id => $field): ?>
    <?php print $field->label_html; ?>
    <?php print $field->content; ?>
<?php endforeach; ?>

how would you write this in jade2php?

ivankravchenko commented 9 years ago

http://jade-lang.com/reference/iteration/

each field, id in fields
    != field.label_html
    != field.content
OnkelTem commented 9 years ago

Ah, thanks, I forgot jade2php is so smart :)