I've just created a new controller as i usually do but, this time I got a problem with routing.
In profiler route matches but I can't reach them and get No route found for "GET /prezzi/listino"
Controller
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
class PricesController extends Controller {
/**
* @Route("/prezzi/listino", name="prezzi_listino")
*/
public function pricesListAction()
{
$list = $this->getDoctrine()->getRepository('AppBundle:Prices')->findAll();
return $this->render('prices/list.html.twig', [
'items' => $list
]);
}
}
Debug Router
$ php bin/console debug:router
----------------------------------- ---------- -------- ------ -------------------------------------------------------
Name Method Scheme Host Path
----------------------------------- ---------- -------- ------ -------------------------------------------------------
[..]
prezzi_listino ANY ANY ANY /prezzi/listino
[..]
----------------------------------- ---------- -------- ------ -------------------------------------------------------
Router Match
$ php bin/console router:match --method GET /prezzi/listino
[OK] Route "prezzi_listino" matches
+--------------+---------------------------------------------------------+
| Property | Value |
+--------------+---------------------------------------------------------+
| Route Name | prezzi_listino |
| Path | /prezzi/listino |
| Path Regex | #^/prezzi/listino$#sD |
| Host | ANY |
| Host Regex | |
| Scheme | ANY |
| Method | ANY |
| Requirements | NO CUSTOM |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: AppBundle:Prices:pricesList |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
| Callable | AppBundle\Controller\PricesController::pricesListAction |
+--------------+---------------------------------------------------------+
Any ideas of where is the error? I think is a distraction cause I haven't see this problem.