Welcome Guest, Not a member yet? Register   Sign In
Trouble implementing a new controller in an existing project.
#6

[eluser]henryboy[/eluser]
[quote author="jedd" date="1248918476"]
I'm not sure why you think the parent::Controller() line should exist in the index() rather than the class's constructor. I suspect you've made some changes from the other controllers without understanding about how constructors work ... ? This is a PHP thing rather than a CI thing, so I'd suggest you read up on the PHP manual about classes/constructors.
[/quote]

Yeah, I just cut and paste a simple hello world snippet I found online. Since controller1 works and controller2 (testing) does not, there is another issue. I have not made any modifications, I have only inserted the test hello world controllers, which I have modified to your example.

I believe it's something happening before Codeigniter is deciding which controller to use. In other words using the same controller file with the file name and class name modified, site.com/controller1/ works fine and site.com/testing/ does not. It seems to be using the default controller defined in the config instead of 'testing'.


Messages In This Thread
Trouble implementing a new controller in an existing project. - by El Forum - 07-29-2009, 03:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB