We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

IndexController handler class cannot be loaded

Excuse me, how to solve this problem



33.8k

Show your index.php and IndexController.php. Also your directory structure.



2.1k
Accepted
answer

if i am right, which i suspect i am. is your controller in a namespace?



25.7k

it'd be nice if you can post your code so we can have more confidence to figure it out. Perhaps it's the acl create an infinite loop (if you're using acl).

Not sure if this was the same issue the above was having, But after registering my namespaces i missed the $di injection fo the namespaces.

$di->set('dispatcher', function () {
    $dispatcher = new Dispatcher();
    $dispatcher->setDefaultNamespace('Join\Controllers');
    return $dispatcher;
});