基本信息
源码名称:基于ci框架的文字发布系统
源码大小:1.89M
文件格式:.rar
开发语言:PHP
更新时间:2017-04-18
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* author:嗜血好龙
* 默认前台控制器
*/
class Home extends CI_Controller{
public $category;
public $title;
public function __construct(){
parent::__construct();
$this->load->model('article_model', 'art');
$this->load->model('category_model', 'cate');
$this->category = $this->cate->limit_category(4);
$this->title = $this->art->title(10);
/*p($this->category );
exit;*/
}
/**
* 默认首页显示方法
*/
public function index(){
$this->output->enable_profiler(false);
//echo base_url() . 'style/index/';
// echo site_url() . '/index/home/category';
$data = $this->art->check();
$data['category'] = $this->category;
$data['title'] = $this->title;
$this->output->cache(5/60);
$this->load->view('index/home.html', $data);
}
/**
* 分类页显示
*/
public function category(){
$data['category'] = $this->category;
$data['title'] = $this->title;
$cid = $this->uri->segment(2);
$data['article'] = $this->art->category_article($cid);
$this->load->view('index/category.html', $data);
}
/**
* 文章阅读页显示
*/
public function article(){
$aid = $this->uri->segment(2);
$data['category'] = $this->category;
$data['title'] = $this->title;
$data['article'] = $this->art->aid_article($aid);
/* p($data['article']);
die();*/
$this->load->view('index/article.html', $data);
}
}