Use text::alternate() instead of hand-rolled even/odd code.

This commit is contained in:
Bharat Mediratta
2009-11-15 19:34:44 -08:00
parent 64ef86a8ee
commit e0f4e6500d
6 changed files with 10 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<? foreach ($comments as $i => $comment): ?>
<li class="<?= ($i % 2 == 0) ? "g-even" : "g-odd" ?>">
<? foreach ($comments as $comment): ?>
<li class="<?= text::alternate("g-even", "g-odd") ?>">
<img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
class="g-avatar"
alt="<?= html::clean_attribute($comment->author_name()) ?>"