$category = new Category(); $categories = $category->getCategories(); //var_dump($categories); if (count($categories) > 0) { ?> <table class="table"> <thead> <tr> <th>#</th> <th>Nume</th> <th>Optiuni</th> </tr> </thead> <?php $cnt = 0; $categories = Category::Paginate(); foreach ($categories as $category) { $cnt++; echo "<tr>"; echo "<td>{$cnt}</td>"; echo "<td>{$category->category_name}</td>"; echo "\n <td>\n <a class=\"btn btn-icon btn-warning edit\" href=\"categories.php?action=edit&id={$category->id}\">\n <i class=\"fa fa-wrench\"></i>\n </a>"; ?> <form id="delete" method="post" action=""> <input type="hidden" name="category_id" value="<?php echo $category->id; ?> "/> <input type="hidden" name="cat_name" value="<?php echo $category->category_name; ?>