e($condition, $a, $b = null)

Echos one of two alternatives depending on a condition (Shortcut for ecco())

  • $condition (mixed)
  • $a (mixed)
    Echoed if $condition is true
  • $b (mixed)
    Echoed if $condition is false


With two options

e(1 == 2, 'hell freezes over', 'everything is ok');
// will most definitely echo 'everything is ok'

With a single option

  <?php foreach($pages as $p): ?>
  <li<?php e($p->isActive(), ' class="active"') ?>>
  <?php endforeach ?>

Is something missing or incorrect? Edit this page on Github…