I am making an list where people can make a blog post active or inactive so i have to check if the status is active or not.
I have a table item called active in my database this is a boolean.
How would i achieve this I have a begin of the view wether it displays an active post or inactive(this part works) but no clue how this would work in the controller or model.
I use font-awesome to display if the post is active or not
PHP Code:
<a href="<?php echo site_url('posts/activate/'. $post_item['id']); ?>">
<?php
if($post_item['active'] == 1) {
echo '<i class="fa fa-check-square-o fa-lg"></i>';
} else {
echo '<i class="fa fa-square-o fa-lg"></i>';
}
?>
</a>