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); } } ?>