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

what is the standard for routing annotattions?

I've been working with annotations routing and sometimes i have problems route.

  1. if the prefix is not equal to the controller I can not access prefix
  2. change the folder view and declare according to the controller or its prefix (camelcase?)
  3. problem between dispatcher and redirect
    //Don't work
    return $this->dispatcher->forward(array(
        'controller' => 'IncidenceSv',
        'action' => 'create'

    return $this->dispatcher->forward(array(
        'controller' => 'incidence_sv',
        'action' => 'create'

actually I have a special case and is a controller called IncidenceSv


    $router = new \Phalcon\Mvc\Router\Annotations(false);


    // 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');

        "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?

edited Jun '15

by default phalcon uncamelize all controllers with '_'. Seems like '-' works too as long you set the controller view folder with one of those names. If you want to change how the action/controller to look like you can control that from the event manager