Reputation: 589
I want my Custom_library
class extend to My_custom_controller
. Is it possible?
Upvotes: 0
Views: 77
Reputation: 1124
If you want to extend simply extend:
class xyz extends utv
{
//class code here
}
But I advise you to load library in constructor to private $var in your controller
class My_custom_controller
{
private $libs;
public function __construct()
{
$this->libs = new Custom_library();
}
}
I advise you that becouse you really don't want to extend library in controller, you can override something by accident, that way you will have access to library and you will be shure that nothing wrong goes with your library
Upvotes: 1