Welcome Guest, Not a member yet? Register   Sign In
Can not create Controller naming 'index'.
#1

[eluser]aerian[/eluser]
On creating a controller namely “index” the following error comes
Quote: Fatal error: Cannot re declare index::index() in C:\wamp\www\websitename\system\application\controllers\index.php on line 10


due to the presence of constructor with the same name.

is the “index” name for controller is prohibited.
#2

[eluser]jdfwarrior[/eluser]
It would appear you've already found the answer Smile
#3

[eluser]Mackstar[/eluser]
You have 2 methods named index, this is what is giving you your error...

Check the class it is being inherited in from if you are inheriting the controller from a custom controller.
#4

[eluser]jdfwarrior[/eluser]
Ha good call I guess I read it too fast and didn't even notice that. Mackstar is right, you have two index functions somewhere.
#5

[eluser]aerian[/eluser]
thanks .
what i m doing is using reserved controller name.[index].

thanks all :-)
#6

[eluser]jdfwarrior[/eluser]
So I'm assuming you did find the list of reserved names in the User Guide?
#7

[eluser]Mackstar[/eluser]
In which case your constructor for your controller would clash with another function named index...

You could add a function to your constructor to call another function as an alias...

But to be honest it sounds like you are trying to do with the controller what you should be doing with routes???




Theme © iAndrew 2016 - Forum software by © MyBB