router.php
use Phalcon\Mvc\Router\Annotations as RouterAnnotations;
$routerA = new RouterAnnotations(false);
$routerA->addResource('Conf', '/conf');
$app->setService('router', $routerA, true);
ConfController.php
/**
* @RoutePrefix('/conf')
*/
class ConfController extends Phalcon\Mvc\Controller
{
/**
* @Get('/')
*/
public function indexAction()
{
//$this->assets->addJs('js/jquery.js');
echo ('ConfController');
d($this->view);
$this->view->render(get_class(), 'indexAction', array());
}
}
index.php
// Initializing application
$app = new \Phalcon\Mvc\Micro();
// Setting DI container
$app->setDI($di);
// Processing request
$app->handle();
And i am getting "Matched route doesn't have an associated handler"
if I dump $app after handle() i see all members begining with _ are empty
_handles must not be empty https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/micro.zep
let matchedRoute = router->getMatchedRoute();
if typeof matchedRoute == "object" {
if !fetch handler, this->_handlers[matchedRoute->getRouteId()] {
throw new Exception("Matched route doesn't have an associated handler");
}
What is wrong? How to populate _handle? Annotations are usable in Micro or in Full/MVC only