private function setCategories() { $postCategory = new \SKS\DB\Entity\PostCategory(); $this->view->categories = $postCategory->findAll(); }
<?php $postCategory = new \SKS\DB\Entity\PostCategory(); $this->categories = $postCategory->findAll(); ?> <div class="well"> <h4>Blog Categories</h4> <div class="row"> <div class="col-lg-12"> <ul class="list-unstyled"> <?php foreach ($this->categories as $category) { $link = URL . "post/category?category_id=" . $category->id; echo "<li><a href='{$link}'>{$category->name}</a>"; } ?> </ul> </div> </div> <!-- /.row --> </div>