Question

I want my Custom_library class extend to My_custom_controller. Is it possible?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top