Question

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

Était-ce utile?

La 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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top