[eluser]whygod[/eluser]
Hi
I just want to clarify my understanding.
Okay the User Manual says, to utilize CodeIgniter Resources within a Library.
I need to do it like this below,
Code:
$CI =& get_instance();
$CI->load->helper('url');
$CI->load->library('session');
$CI->config->item('base_url');
So meaning when extending the MY_Controller below is not right?
MY_Controller:
Code:
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
public $data = array();
function __construct ()
{
parent::__construct();
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->library('jaz_lib');
}
}
Custom library: Jaz_lib.php
Code:
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Jaz_lib extends MY_Controller
{
public $data = array(
'' => '',
);
function __construct ()
{
parent::__construct();
}
public function logout()
{
//Destroy session
$this->session->sess_destroy();
//Delete coockie
return TRUE;
}
}
Meaning the classes that was loaded in the MY_Controller,
will not be inherited in Jaz_lib library?
Thanks in advanced.