first commit
This commit is contained in:
26
application/controllers/news.php
Executable file
26
application/controllers/news.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user