Welcome Guest, Not a member yet? Register   Sign In
Controller naming PascalCase
#1
Sad 
(This post was last modified: 12-12-2019, 12:47 PM by RedskyThirty.)

I've lost more than 3 hours today with this issue.

I tried my project on a web server today and I didn't understand why most of my urls returned to a 404 error when I had no problem locally.
I understood that this was due to the name of my controllers which are named in PascalCase (ex: MyProfile.php). For now, the only way to solve this is to rename my controllers like this "Myprofile.php" but that disturbs me, I don't find this clean.
May be it can be solved with "mod_speling" (CheckSpelling and CheckCaseOnly) but I cannot edit the "httpd.conf" file.

What do you think about this?

I found a solution. It's not really good but it works.
I can add some routes like this:
PHP Code:
$routes->add('myprofile''App\Controllers\MyProfile::index');
$routes->add('myprofile/(:any)''App\Controllers\MyProfile::$1'); 
Reply


Messages In This Thread
Controller naming PascalCase - by RedskyThirty - 12-12-2019, 12:24 PM
RE: Controller naming PascalCase - by ciadmin - 12-12-2019, 01:53 PM
RE: Controller naming PascalCase - by dave friend - 12-19-2019, 12:02 AM
RE: Controller naming PascalCase - by MGatner - 12-20-2019, 07:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB