20 lines
633 B
PHP
20 lines
633 B
PHP
<?php
|
|
class News extends CI_Controller{
|
|
public function __construct() {
|
|
parent::__construct();
|
|
$this->load->model('news_model');
|
|
}
|
|
public function index() {
|
|
$array['news'] = $this->news_model->get_news();
|
|
$data['title'] = 'News archive';
|
|
//$data['content'] = 'testing';
|
|
$data['content'] = $this->load->view('news/index',$array,true);
|
|
$this->load->view('templates/main',$data);
|
|
}
|
|
public function view($slug) {
|
|
$data['title'] = 'News testing';
|
|
$data['content'] = 'content ' . $slug;
|
|
$this->load->view('templates/main', $data);
|
|
}
|
|
}
|