i have start working with CodeIgniter, but i can’t understand one think. How do i load one class into another?
$this->load->library("hello_world");
This is not working?
my class -> load -> hello_world class
class myclass {
function test() {
$this->load->library("hello_world");
$this->hello_world->hello();
}
}
Message: Undefined property: myclass::$load
The ability to load a class depends on the load->library function being available. It is made available to the controller and model classes, but extending these may not be appropriate for your use.
Instead you can either get a reference to CI and use that to load and refer to your class, or you can load it as usual in PHP ($c = new MyClass).
To get a rerence to CI use the following: