Skip to Content
CodeIgniter Project Completed.
codeigniter code / August 8, 2018

Project Complated in codeignter

step 1 : created articlsmodel.php function find in model
return $q->row();
return false;
step 2 : created user.php function find in controller
public function article($id )
step 3: created article_detail.php in view

<?php include_once(‘public_header.php’);?>
<div class=”container”>
<div class=”row”>
<div class=”col-lg-6″>
<?= $article->title;?>
<div class=”col-lg-6″>
<span class=”pull-right”>
<?= date(‘d M y H:i:s’,strtotime($article->created_at))?>
<?= $article->body;?>

<?php include_once(‘public_footer.php’);?>

step 4 created article_list.php in view

<?php include (‘public_header.php’);?>
<div class=”container”>
<h1>All Articles</h1>
<table class=”table”>
<td>Sr No.</td>
<td>Article Title</td>
<td>Published On</td>
<?php if(count($articles)):?>
<?php $count=$this->uri->segment(3,0);?>
<?php foreach($articles as $article ):?>
<td><?= ++$count?></td>
<td><?= anchor(“user/article/{$article->id}”,$article->title)?></td>
<td><?= date(‘d M y H:i:s’,strtotime($article->created_at))?></td>
<?php endforeach;?>

<?php else: ?>
<td colspan=”3″> No Records Found.</td>
<?php endif;?>
<?= $this->pagination->create_links()?>

<?php include (‘public_footer.php’);?>s

No comments yet, take the initiative.

Leave a Reply

Your email address will not be published.

PHPCODE © 2023