Welcome Guest, Not a member yet? Register   Sign In
Can a Controller extend another Controller?
#3

[eluser]Michael Ekoka[/eluser]
You can create a set of base controllers for your application and store them in /application/libraries/MY_Controller.php.

Code:
class Users_Controller extends Controller{

}

class App_Controller extends Controller{

}

class Admin_Controller extends Controller{

}
Then you can just declare your other controllers in /application/controllers/ like
Code:
class Members extends Users_Controller{
}

If you need to extend one of your application's controllers instead, make sure to include the file at the top of the script like you would normally :
Code:
include APPPATH.'controllers/members.php';
class Gold extends Members{
}


Messages In This Thread
Can a Controller extend another Controller? - by El Forum - 11-20-2007, 01:03 PM
Can a Controller extend another Controller? - by El Forum - 11-20-2007, 04:28 PM
Can a Controller extend another Controller? - by El Forum - 11-20-2007, 04:41 PM
Can a Controller extend another Controller? - by El Forum - 11-20-2007, 08:01 PM
Can a Controller extend another Controller? - by El Forum - 11-21-2007, 12:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB