Codeigniter_Blog_App/application/views/categories/index.php

12 lines
537 B
PHP
Raw Permalink Normal View History

2024-07-11 04:23:32 +00:00
<h2><?= $title; ?></h2>
<ul class="list-group">
<?php foreach($categories as $category) : ?>
<li class="list-group-item"><a href="<?php echo site_url('/categories/posts/'.$category['id']); ?>"><?php echo $category['name']; ?></a>
<?php if($this->session->userdata('user_id') == $category['user_id']): ?>
<form class="cat-delete" action="categories/delete/<?php echo $category['id']; ?>" method="POST">
<input type="submit" class="btn-link text-danger" value="[X]">
</form>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>