Welcome Guest, Not a member yet? Register   Sign In
Routing a user based on their role.
#6

[eluser]bretticus[/eluser]
CI has a PHP 4 approach to extending core classes. That is, CI checks for the existence of a MY_ prefixed version of the core class and uses it if it exists. You simply extend the core class to get all the functionality of that class and then make the changes/additions that you need. Yes, you can extend the controller class in this manner (if you want to break with the framework PHP 4 paradigm, you can autoload classes a la PHP 5. There are tutorials out there but I assume that include is probably comparable for performance.)

According to the PHP manual:

Quote:Any class that contains at least one abstract method must also be abstract.

Thus, I don't think you want to make an abstract class to replace controller. Either extend the controller class with a MY_ version or build a standalone library file (Member_Controller) that extends the controller class. If you really want an abstract class to inherit role classes from, just build one independent from controller functionality and call it in your controller constructor.


Messages In This Thread
Routing a user based on their role. - by El Forum - 01-24-2010, 10:00 AM
Routing a user based on their role. - by El Forum - 01-24-2010, 10:54 AM
Routing a user based on their role. - by El Forum - 01-24-2010, 06:02 PM
Routing a user based on their role. - by El Forum - 01-24-2010, 07:44 PM
Routing a user based on their role. - by El Forum - 01-24-2010, 08:28 PM
Routing a user based on their role. - by El Forum - 01-24-2010, 08:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB