Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Created February 29, 2012 14:12
Show Gist options
  • Save bastianallgeier/1941133 to your computer and use it in GitHub Desktop.
Save bastianallgeier/1941133 to your computer and use it in GitHub Desktop.
<ul class="tags">
<?php foreach(str::split($article->tags()) as $tag): ?>
<li><a href="<?php echo url('blog/tag:' . urlencode($tag)) ?>"></a></li>
<?php endforeach ?>
</ul>
@simonnickel
Copy link

Bei mir sieht das aktuell so aus, geht bestimmt schöner:

<?php 
    $count = 0;
    foreach ($tags = explode(",", $article->tags()) as $tag) {
        $count++;
        echo '<a href="'.url().'devlog/tag:'.urlencode(trim($tag)).'">'.str_replace('-',' ', $tag).'</a>';
        if ($count != count($tags)) {echo ',';}
    }
?>

Tags aus mehreren Wörtern lassen sich dann so hinterlegen: "Dies-ist-ein-Tag"

@bastianallgeier
Copy link
Author

ja, so geht's auch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment