I'm having trouble understanding the namespacing for Phalcon. I have been looking at the docs and example but I am missing something, perhaps because its 4am now :) I keep getting: AccountController handler class cannot be loaded
/app/controllers/dashboard/AccountController.php
<?php
namespace Dashboard;
class AccountController extends \BaseController
{
}
/app/config/Routes.php
$this->add('/dashboard/:controller', [
'namespace' => 'Dashboard',
'controller' => 1,
]);
/public/index.php (Bootstrap)
// -----------------------------------
// Register the autoloader
// -----------------------------------
$loader = new \Phalcon\Loader();
$loader->registerNamespaces([
"Dashboard" => "../app/controllers/dashboard/", // ? This doesnt do anything :(
]);
$loader->registerDirs([
'../app/controllers/',
'../app/controllers/dashboard/', // ? this works without namespaces :(
'../app/controllers/admin/',
'../app/models/',
'../app/config/',
'../app/event/',
'../app/library/',
]);
$loader->register();
Can anyone tell why my namespace is not registering and behaving?