Skip to Content
Codeigniter Edit Button
codeigniter code / August 1, 2018

Edit Button in Codeigniter

step 1: Created view in dashboard.php

<?php if(count($articles)):?>
<?php foreach($articles as $article):?>
<td><?php echo $article->title?></td>
<?php echo anchor(“admin/edit_article/{$article->id}”,’Edit’,[‘class’=>’btn btn-primary’]);?>
<!– <a href=”#” class=”btn btn-primary”>Edit</a> –>
<a href=”#” class=”btn btn-danger”>Delete</a>
<?php endforeach; ?>
<?php else:?>

step 2: Created Controller in dashboard.php
public function edit_article($article_id)
echo $article_id;

No comments yet, take the initiative.

Leave a Reply

Your email address will not be published.

PHPCODE © 2023