Namespaces for Controller

Can I use Namespace directory for my contollers? If i try, I get error "Namespace/controllerController handler class cannot be loaded"

In router I wrote: $router->add('/uri/', 'namespace/controller::index');



22.3k

Don't you see the difference between strings Phalcon\Config\Adapter\Ini and Namespace/Controller ?



84.4k

It's better use the array syntax here:

$router->add('/uri/', array(
     'namespace' => 'Namespace\Subnamespace',
     'controller' => 'some-controller'
));