Hi ! I am using annotations to define routes. But i have troubles with a route for a subresource.
I need an endpoint to manage the users addresses in my REST API, so i defined the next resource:
<?php
use Phalcon\Mvc\Router\Annotations as RouterAnnotations;
/* More ... */
$router = new RouterAnnotations(false);
$router->addResource("Addresses", "/users/{idUser:[0-9]+}/addresses");
/* More ... */
And in my AddressesController:
<?php
use Phalcon\Mvc\Controller;
use Services\Customers as CustomersService;
/**
* @RoutePrefix("/users/{idUser:[0-9]+}/addresses")
*/
class AddressesController extends Controller {
/**
* @Get("/{idAddress}")
* @param int $idUser Id del usuario.
* @param int $isAddress Id del domicilio.
*/
public function readAction($idUser, $idAddress) {
var_dump($idUser, $idAddress);
}
}
So, when i do a GET requesto to /users/10/addresses/2 Phalcon dispatch to 404 page. Any ideas ?