|
发表于 2017-3-2 11:11:28
|
显示全部楼层
能给我个源码吗? 511012784@qq.com 你的代码我下载了,数据库导入了添加有记录,列表信息显示不出来article.php 没数据,求完整的,
public function index($page=0)
{
$this->load->library('pagination');
$per_page=$this->config->item('per_page','pagination');
$limit=array(
'num'=>$per_page,
'offset'=>$page,
);
// var_dump($limit);
$data=array(
//从数据库中index=2的条目开始,取出5条
'articles'=>$this->article->get_article($limit)
);
//var_dump ($data);exit;
$this->config->set_item('total_rows',$this->article->get_articles_count(),'pagination');
//$this->config->set_item('base_url',site_url().'/article/index','pagination');
$this->pagination->initialize($this->config->item('pagination'));
$this->load->view('article_list',$data);
} |
|