Welcome Guest, Not a member yet? Register   Sign In
Join Query Help
#16

[eluser]Lee.[/eluser]
and my controller:

Code:
<?php
class News extends CI_Controller {

public function __construct()
{
parent::__construct();
$this->load->model('news_model');
}
    
    function index()
    {
        // Grab our view data from the blog model.
        $data['article_entries'] = $this->news_model->get_news();
        
        // Load the views.
  $this->load->view('templates/header');
        $this->parser->parse('news/index', $data);
  $this->load->view('templates/footer');
    }

public function view($slug)
{
        // Grab our view data from the blog model.
        $data['article_entries'] = $this->news_model->get_news($slug);
        
        // Load the views.
  $this->load->view('templates/header');
        $this->parser->parse('news/view', $data);
  $this->load->view('templates/footer');
}



public function create()
{
$this->load->helper('form');
$this->load->helper('ckeditor');
$this->load->library('form_validation');


$data['title'] = 'Create a news item';

$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('text', 'text', 'required');

if ($this->form_validation->run() === FALSE)
{
  $this->load->view('templates/header', $data);
  $this->load->view('news/create');
  $this->load->view('templates/footer');
  
}
else
{
  $this->news_model->set_news();
  $this->load->view('news/success');
}
}

}


Messages In This Thread
Join Query Help - by El Forum - 05-28-2013, 07:58 AM
Join Query Help - by El Forum - 05-28-2013, 10:56 AM
Join Query Help - by El Forum - 05-28-2013, 11:39 AM
Join Query Help - by El Forum - 05-28-2013, 11:54 AM
Join Query Help - by El Forum - 05-28-2013, 12:00 PM
Join Query Help - by El Forum - 05-28-2013, 12:00 PM
Join Query Help - by El Forum - 05-28-2013, 12:05 PM
Join Query Help - by El Forum - 05-28-2013, 01:09 PM
Join Query Help - by El Forum - 05-28-2013, 02:42 PM
Join Query Help - by El Forum - 05-29-2013, 04:00 AM
Join Query Help - by El Forum - 05-29-2013, 04:00 AM
Join Query Help - by El Forum - 05-29-2013, 04:00 AM
Join Query Help - by El Forum - 05-29-2013, 04:00 AM
Join Query Help - by El Forum - 05-29-2013, 05:10 AM
Join Query Help - by El Forum - 05-29-2013, 12:35 PM
Join Query Help - by El Forum - 05-29-2013, 12:36 PM
Join Query Help - by El Forum - 05-29-2013, 12:39 PM
Join Query Help - by El Forum - 05-30-2013, 09:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB