Welcome Guest, Not a member yet? Register   Sign In
Do I need to upgrade my version of CodeIgniter?
#27

[eluser]Bob Puzld[/eluser]
Next controller file... districts.php

<?php

class Districts extends Controller {
function Districts() {
parent::Controller();

$this->load->model('district_model','mdlDistrict');

$this->load->library('auth',array('redirect'=>'main','hash_key'=>$this->config->item('hash_key')));
}

function index() {
$data2['districts'] = $this->mdlDistrict->GetAll();

$data = array('page_title'=>'Manage Districts',
'left_col'=>$this->load->view('nav',0,true),
'right_col'=>$this->load->view('districts/index',$data2,true));

$this->load->view('index', $data);
}

function add() {
// validate input
$rules = array('name'=>'required');

$this->validation->set_rules($rules);

// check for errors
if($this->validation->run() == FALSE) { // if there were errors...
$this->index();
}
else {
$this->mdlDistrict->AddDistrict();
redirect('districts/index');
}
}
}

?>


Messages In This Thread
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 12:40 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 02:23 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 05:30 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 08:19 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 09:31 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 10:19 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 10:25 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-24-2009, 11:54 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 12:17 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 12:27 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 12:38 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 12:58 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 02:42 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-27-2009, 05:46 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-29-2009, 01:51 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-29-2009, 01:58 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-30-2009, 08:42 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-30-2009, 09:35 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-30-2009, 12:07 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-30-2009, 12:24 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-30-2009, 12:36 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 10:30 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 10:38 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 11:39 AM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:01 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:17 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:18 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:19 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:20 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:22 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:27 PM
Do I need to upgrade my version of CodeIgniter? - by El Forum - 03-31-2009, 12:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB