Before I put in the space of my application (test application), everything worked fine. But after I started the namespace of the controllers, and that’s it, and loading the namespaces, like this:
$loader = new Loader();
$loader->registerNamespaces(
array(
'Application\Controllers' => 'Application/Controllers/'
)
)->register();
I get an error Exception: IndexController handler class cannot be loaded
The correct namespace has been entered:
namespace Application\Controllers;
use Phalcon\Mvc\Controller;
class IndexController extends Controller {
public function indexAction() {
echo "Hello World";
}
}

(source: gyazo.com )
I managed to fix this by adding a default namespace to the router:
$router = new Router();
$router->setDefaultNamespace('Application\Controllers');
But this may cause me further problems because the namespace loader does not work.
What happened?
source
share