Welcome Guest, Not a member yet? Register   Sign In
Extending a controller while in a sub-folder.
#1

[eluser]internut[/eluser]
Hey All,

I have an /admin/ folder in /controllers/:

/controllers/admin/

I'm trying to extend it by using in the welcome controller:

/controllers/admin/welcome.php

class Welcome extends Admin_Controller {

Admin_Controller.php is in:

/libraries/AdminController.php

Its not using it though?

If I put the controller in the main:

/controllers/

folder it works fine.

I've done things based off of:

http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY

Any thoughts?

Jason
#2

[eluser]InsiteFX[/eluser]
CI 1.7.x application/libraries
MY_Controller
Admin_Controller extends MY_Controller
Public_Controller extends MY_Controller

CI 2.0 application/core
MY_Controller
Admin_Controller extends MY_Controller
Public_Controller extends MY_Controller

This
/libraries/AdminController.php

This should be
/libraries/Admin_Controller.php

Then extend your application/controllers/welcome.php from Admin_Controller

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB