I've been working with annotations routing and sometimes i have problems route.
- if the prefix is not equal to the controller I can not access prefix
- change the folder view and declare according to the controller or its prefix (camelcase?)
- problem between dispatcher and redirect
//Don't work return $this->dispatcher->forward(array( 'controller' => 'IncidenceSv', 'action' => 'create' )); //Work return $this->dispatcher->forward(array( 'controller' => 'incidence_sv', 'action' => 'create' ));
actually I have a special case and is a controller called IncidenceSv
<?php $router = new \Phalcon\Mvc\Router\Annotations(false); $router->removeExtraSlashes(true); $router->setUriSource(\Phalcon\Mvc\Router::URI_SOURCE_SERVER_REQUEST_URI); // addResource(Controller,Prefix) $router->addResource('Index', '/'); $router->addResource('Login', '/login'); $router->addResource('CallsSv', '/calls'); //prefix is not equal to the controller $router->addResource('Users', '/users'); // incidencesv don't work $router->addResource('IncidenceSv', '/incidence_sv');//work $router->addResource('Error', '/error'); $router->notFound([ "controller" => "Error", "action" => "page404" ]); return $router;
and the route in the i can access is
and the other routes have camelcase (correct)
some can orient me?