Welcome Guest, Not a member yet? Register   Sign In
Extanding the CI_Controller ot working
#11

[eluser]YahyaKACEM[/eluser]
still nothing, the same errors.
#12

[eluser]YahyaKACEM[/eluser]
this is so embarrassing it was just the wrong file name instead of MY_Controller.php i save the file with the name MY_Contorller.php and @jmadsen & @InsiteFX no need for the autoload function in the config file it's already autoloaded. sorry for that and thanx for your help.
#13

[eluser]InsiteFX[/eluser]
You only need the autoload in the config if you extend more Controllers from the MY_Controller.

Where I have two other ones Admin_Controller and Public_Controller

Code:
application/core/
-- MY_Controller extends CI_Controller
-- Admin_Controller extends MY_Controller
-- Public_Controller extends MY_Controller

Then you need the config autoload or it will not see the other Controllers.
#14

[eluser]YahyaKACEM[/eluser]
thank you, i think i'm about to add an admin an public controllers you probably saved me some time with this reply, thanx.
#15

[eluser]PhilTem[/eluser]
[quote author="InsiteFX" date="1353511800"]You only need the autoload in the config if you extend more Controllers from the MY_Controller.

Where I have two other ones Admin_Controller and Public_Controller

Code:
application/core/
-- MY_Controller extends CI_Controller
-- Admin_Controller extends MY_Controller
-- Public_Controller extends MY_Controller

Then you need the config autoload or it will not see the other Controllers.
[/quote]

Do you really need to do this? I have some hierarchical controllers and loading them works fine
Code:
application/core/
  class MY_Controller extends MX_Controller {}
  class Public_Controller extends MY_Controller {}
  class Authenticated_Controller extends Public_Controller {}
  class Admin_Controller extends Authenticated_Controller {}
  class HMVC_Controller extends MX_Controller {}
  class AJAX_Controller extends MY_Controller {}

Or does it work for me because I'm using HMVC?
#16

[eluser]CroNiX[/eluser]
HVMC has it's own built-in autoload, so yes.




Theme © iAndrew 2016 - Forum software by © MyBB