<?php defined('BASEPATH') or exit('No direct script access allowed');

class News extends CI_Controller
{

    public function __construct() {
        parent::__construct();
        $this->load->library('user_agent');
        $this->load->library('Post', '', 'post');
    }

    public function index() {
        $post = $this->db->limit(1)->order_by('reg_date', 'desc')
        ->select('main_img mainImg, news.*')
        ->get('news')->row();
        $this->load->view('news/news', array('post' => $post));
    }

    public function category() {
        $post = $this->db->limit(1)->order_by('reg_date', 'desc')
        ->select('main_img mainImg, news.*')
        ->get('news')->row();
        $this->load->view('news/category', array('post' => $post));
    }

}