123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- !defined('BASEPATH') && exit('No direct script access allowed');
- class News extends MY_Main_Controller
- {
- public function __construct()
- {
- parent::__construct();
- $this->load->model('news_model','news');
- }
- public function index()
- {
- $type = 1;
- $items = $this->news->all($type);
- $data['items'] = $items;
- $data['type'] = $type;
- $this->load_view($data);
- }
- public function trade()
- {
- $type = 2;
- $items = $this->news->all($type);
- $data['items'] = $items;
- $data['type'] = $type;
- $this->load_view($data);
- }
- public function read()
- {
- $id = $this->input->get('id');
- $item = $this->news->get($id);
- $type = $item['type'];
- $relate = $this->news->get_last($type);
- $count = $this->news->count();
- $data['item'] = $item;
- $data['relate'] = $relate;
- $data['count'] = $count;
- $this->action_name = __FUNCTION__;
- $this->load_view($data);
- }
- }
- ?>
|