Hello,
I am developing a multi modules application and following the tuts on https://docs.phalcon.io/en/latest/reference/applications.html#multi-module
So far the app works just fine, but when I integrated it with Annotations Routing, it keeps showing
Class Multiple\Backend\Controllers\IndexController does not exist
Here is my change to the tutorial files:
In the bootstrap file:
//Specify routes for modules
$di->set('router', function () {
$router = new Router\Annotations();
$router->addModuleResource('backend', 'Multiple\Backend\Controllers\Index', '/api');
return $router;
});
In the apps/backend/controllers/IndexController.php
<?php
namespace Multiple\Backend\Controllers;
/**
* @RoutePrefix("/api")
*/
class IndexController extends \Phalcon\Mvc\Controller
{
/**
* @Get("/test")
*/
public function indexAction()
{
echo "stream";
}
}
Yet when I access via the URL:
It always shows:
Class Multiple\Backend\Controllers\IndexController does not exist
Is there anything I've done wrong with the Annotations?