1
0

Don't treat objects like strings. Simplify the code.

This commit is contained in:
Bharat Mediratta 2009-12-24 11:04:25 -08:00
parent 30ab3e9420
commit 9a1fc57211

View File

@ -1,10 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="g-display-tags-block">
<? for ($counter=0; $counter<count($tags); $counter++) { ?>
<? if ($counter < count($tags)-1) { ?>
<a href="<?= url::site("tags/$tags[$counter]") ?>"><?= html::clean($tags[$counter]->name) ?></a>,
<? } else {?>
<a href="<?= url::site("tags/$tags[$counter]") ?>"><?= html::clean($tags[$counter]->name) ?></a>
<? } ?>
<? } ?>
<? $not_first = 0; ?>
<? foreach ($tags as $tag): ?>
<?= ($not_first++) ? "," : "" ?>
<a href="<?= url::site("tags/{$tag->name}") ?>"><?= html::clean($tag->name) ?></a>
<? endforeach ?>
</div>