Router short syntax and multi-word controller names

The short syntax seems to be incompatible with controller classes containing multiple words.

<?php

class ProductCategoryController {
  function indexAction() { ... }
}

$router->add("/products/categories", "ProductCategory::index");
print $router->getControllerName();

getControllerName() returns an all lowercase controller name and the dispatcher looks for a class called ProductcategoryController. Instead of simply lowercasing wouldn't it make more sense to use snake-case. Then transformation can be reversed and the dispatcher can resolve the controller name properly.



83.0k

Good point and I agree, can you please open a NFR for this on Github? https://github.com/phalcon/cphalcon



83.0k

Thanks Tim

I know this post is old, but this should also be added in docs since is quite important. It took me 2 hours to find how phalcon is handling multi word controllers. Thanks