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

Controller Name using camelcase

Hi,, i was developing web a app with Phalcon on windows OS,

I created a controller MsCompanyController.php on windows and this controller works fine.

but when I run in linux I get error

MscompanyController handler class cannot be loaded

when I rename MsCompanyController.php to MscompanyController.php in linux it worked fine.

Anyone can help me, without renaming the controller filename, because I have wrote a lot of code?

edited Mar '14

I wrote dedicated converter for your needs, it should work for you any controller parameter which goes to router, for example MsCompany, MyProfile.TryThis etc without adding dedicated routes, but take care about this converter and secure it

url: https://localhost/MsCompany/index
        "controller" => 1,
        "action" => 2,
        "params" => 3
)->convert('controller', function($controller) {
        $new_controller = array();
            $lowercase = strtolower($controller[$i]);
            if(ord($controller[$i])<=90 && $i>0)
        return implode('',$new_controller);
class MsCompanyController extends \Phalcon\Mvc\Controller
    public function indexAction()
        echo "Controller: ", $this->dispatcher->getControllerName();
        echo "<br>";
        echo "Action: ",$this->dispatcher->getActionName();


Controller: ms_company
Action: index


great, it's work!

Thank you very much.


Strangely it all All works in default....


namespace FM\Apps\Frontend\Controllers;

 * Description of IndexController
 * @author 
 * @RoutePrefix("/camel")
class MyCamelController extends \FM\Apps\Frontend\Controllers\ControllerBase
     * [indexAction description]
     * @return [type] [description]
     * @Get("/")
    public function indexAction()


MsCompanyController.php on windows and this controller works fine??

My environment is windows also, it doesn't work. I must change it to MscompanyController.php