[eluser]SubnetZero[/eluser]
Hello all,
I've got this really weird condition where I can load libraries (in fact anything) in my controller's __construct() method and the corresponding library (helper, etc) is loaded successfully. However, if I load the library (etc) in a method, then the object is not available.
This works:
Code:
Class MyController extends Controller
{
function __construct()
{
parent::Controller();
$this->load->library('validation');
}
function someMethod()
{
print_r($this->validation);
}
}
This does NOT work:
Code:
Class MyController extends Controller
{
function __construct()
{
parent::Controller();
}
function someMethod()
{
$this->load->library('validation');
print_r($this->validation);
}
}
This does not seem to be consistent with the documentation nor the examples I'm seeing. Has anyone else seen this behavior?
The exact error message I'm getting is: Undefined property: MyController::$validation