<?php if ($a == 5): ?>
A равно 5
<?php elseif ($a == 6): ?>
A равно 6
<?php else: ?>
А не равно ни 5 ни 6
<?php endif; ?>
выглядит гораздо лучше, чем{% if a == 5 %}
A равно 5
{% elseif a == 6 %}
A равно 6
{% else %}
А не равно ни 5 ни 6
{% endif %}
да? а код<ul>
{% for user in users if user.active %}
<li>{{ user.username }}</li>
{% else %}
<li><em>no active user found</em></li>
{% endfor %}
</ul>
можете переписать на php сами и порадоваться.<ul>
<?php if(count($users)): ?>
<?php foreach($uasers as $user): ?>
<?php if($user->active): ?>
<li><?= $user->username ?></li>
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<li><em>no active user found</em></li>
<?php endif; ?>
</ul>
или<ul>
<?php if(count($users)):
foreach($users as $user):
if($user['active']): ?>
<li><?= $user['username'] ?></li>
<?php endif;
endforeach;
else: ?>
<li><em>no active user found</em></li>
<?php endif; ?>
</ul>
для вас выглядит более лучше, чем<ul>
{% for user in users if user.active %}
<li>{{ user.username }}</li>
{% else %}
<li><em>no active user found</em></li>
{% endfor %}
</ul>
и готовы терпеть даже такой банальный пример ради того, чтоб не "подключать библиотеку" (наверное микроволновки программируете), то шаблонизаторы реально вам не нужны.<ul>
<? if( ! empty( $users)): ?>
<? foreach( users as user): ?>
<li><?= user[ 'username'] ?></li>
<? endfor; ?>
<? else: ?>
<li><em>no active user found</em></li>
<? endif: ?>
</ul>
<ul>
{% for user in users if user.active %}
<li>{{ user.username }}</li>
{% else %}
<li><em>no active user found</em></li>
{% endfor %}
</ul>