[eluser]toopay[/eluser]
About loading library and helper at once in constructor, here you can do that...
Code:
class Events_awards extends CI_Controller{
public function _construct()
{
parents::_construct();
$this->load->helper(array('html', 'url', 'form'));
$this->load->library(array('session', 'table'));
$this->load->database();
}
function index()
{
/* Now you can remove this, since we already put that at constructor
$this->load->helper('html');
$this->load->helper('url');
$this->load->library('session');
$this->load->library('table');
$this->load->database();
*/
$data['title'] = "Administrator";
$this->load->view('events-awards-list', $data);
}
function add_event()
{
/* This not necessary anymore too
$this->load->helper('html');
$this->load->helper('url');
$this->load->library('session');
$this->load->helper('form');
$this->load->helper(array('form', 'url'));
$this->load->database();
*/
$data['title'] = "Administrator";
if(!$this->input->post('submit'))
{
$this->load->view('events-awards-add', $data);
}
if($this->input->post('submit'))
{
$this->load->model('events_awards_model');
$this->events_awards_model->insert_event();
redirect('events_awards');
}
}
}
About autoloading your resources, read about that at :
http://ellislab.com/codeigniter/user-gui...oader.html