We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

url case matter

I name a controller as "SelectRoomController", url can not find

my url: /admin/selectroom/index

Phalcon\Mvc\Dispatcher\Exception: MyApp\Controllers\Admin\SelectroomController handler class cannot be loaded
 File=/opt/nginx/html/ycf_direct_selling/public/index.php
 Line=39
 Trace=#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('MyApp\\Controlle...', 2)
1 [internal function]: Phalcon\Dispatcher->dispatch()
2 /opt/nginx/html/ycf_direct_selling/public/index.php(39): Phalcon\Mvc\Application->handle()
3 {main}


77.7k
Accepted
answer
edited Jul '16

Take a look at the Text::camelize() method: https://docs.phalcon.io/en/latest/api/Phalcon_Text.html

If you have a SelectRoomController, the corresponding url would be /admin/select_room/index

Phalcon for some reason(windows ?) just expect controllers with lowercased prefix and only first letter uppercase.



1.7k

we tested it with same nginx config, result show centos 7 is ok, but centos 6.5 fail.



1.7k

thanks, it's ok.

Take a look at the Text::camelize() method: https://docs.phalcon.io/en/latest/api/Phalcon_Text.html

If you have a SelectRoomController, the corresponding url would be /admin/select_room/index