Welcome Guest, Not a member yet? Register   Sign In
multiple Controller extender
#9

[eluser]Colin Williams[/eluser]
You can include and require from a class member function, absolutely. You might be trying it within the class but outside a function, which isn't allowed.

Code:
class Someclass {

   include APPPATH . 'path/to/file.php';
   // Not allowed

   function some_method() {

   }

}

What I suggested has nothing to do with the include happening within a function or method. In fact, if you did it that way, you would limit the scope of the include, which is not at all what you want. Your MY_Controller.php file would look something like:

Code:
include '/var/www/ci/application/controllers/base/admincontroller.php';
include '/var/www/ci/application/controllers/base/appcontroller.php';
// etc.


Messages In This Thread
multiple Controller extender - by El Forum - 01-15-2009, 07:29 PM
multiple Controller extender - by El Forum - 01-15-2009, 08:54 PM
multiple Controller extender - by El Forum - 01-15-2009, 09:14 PM
multiple Controller extender - by El Forum - 01-15-2009, 09:44 PM
multiple Controller extender - by El Forum - 01-15-2009, 10:46 PM
multiple Controller extender - by El Forum - 01-16-2009, 01:45 AM
multiple Controller extender - by El Forum - 01-18-2009, 06:44 PM
multiple Controller extender - by El Forum - 01-19-2009, 08:30 PM
multiple Controller extender - by El Forum - 01-19-2009, 10:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB