Control Structures

Aah control structures are still in development.

If

?if(%name == 'Homer'):
    +h4: My name is Bart
?elseif(%name == 'Bart'):
    +h4: My name is Bart
?else:
    +h4: I'm not Homer or Bart
?endif

PHP Equivalent

if($name == 'Homer') {
    echo '<h4>My name is Zoe</h4>';
} elseif($name == 'Bart') {
    echo '<h4>My name is Bart</h4>';
} else {
    echo '<h4>I'm not Homer or Bart</h4>';  
}

Foreach

+ul
    ?foreach(%shows as %show):
        +li: %show
    ?endforeach

PHP Equivalent

<ul>
    <?php foreach($shows as $show): ?>
        <li><?php echo $show; ?></li>
    <?php endforeach; ?>
</ul>

Times

Repeat a statement x number of times.

+ul
    ?times(5):
        +li: This will repeat 5 times!
    ?endtimes