CodeIgniter Forums

Full Version: Can't use underscores in controllers?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
I was writing a controller and put an underscore and it wouldn't take it.

I named my file /controller/forgot_password.php

the url /index.php/forgot_password.php would not go to it

renaming to /controller/forgotpassword.php

and using the url

/index.php/forgotpassword

worked. Am I doing something wrong or is this a bug?

I'm using CodeIgniter 1.7.2

El Forum

[eluser]cahva[/eluser]
You are doing something wrong. You can use underscore with your controller. I see that you tried url:
/index.php/forgot_password.php

You are using .php extension in the url and thats not usually used(unless you have set the extension to be .php in the config).

That would explain why url /index.php/forgotpassword would work with changed controllername and because it didnt have .php extension.