Clarification about MY_Controller and relative inheritances |
(04-18-2017, 01:57 AM)Martin7483 Wrote:(04-17-2017, 04:37 PM)daveĀ friend Wrote: But, if MY_Controller does not mess with any CI_Controller properties (and it only has one - private static $instance; so there is nothing to mess with) then technically he does not need to explicitly call the base class constructor. PHP will do it anyway. The point I failed to make is that however he has defined MY_Controller it must be OK. If it was not then his call to $this->load->model('Auth_Model'); in Dashboard::index() would produce the error: "Undefined property: Dashboard::$load". But he says it works. If Dashboard has access to $load then CI_Controller::__construct() did execute. Still, it would be nice to see the code for MY_Controller and to see the error message he mentions. |
Welcome Guest, Not a member yet? Register Sign In |