/
articles.php
38 lines (32 loc) · 889 Bytes
/
articles.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
class Articles extends Public_Controller
{
function __construct()
{
parent::__construct();
}
function index($category_id)
{
$categories = new Category();
$data['categories'] = $categories->where('parents = '.$category_id)->order_by('lft','asc')->get();
$this->template->build('information',$data);
}
function inc_tab($category_id,$view)
{
$categories = new Category();
$data['categories'] = $categories->where('parents = '.$category_id)->order_by('lft','asc')->get();
$this->load->view($view,$data);
}
function view($id)
{
$data['article'] = new Article($id);
$this->template->build('information_view',$data);
}
function inc_article($category_id,$view)
{
$articles = new Article();
$data['articles'] = $articles->where('category_id = '.$category_id)->order_by('id','desc')->limit(5)->get();
$this->load->view($view,$data);
}
}
?>