Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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: http://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()