I've set up a route using annotations. Looks right to me, Symfony2 says it's wrong. Here's the route:
@Route("/news/{id}/{slug}", name="newsarticle")
Here's a sample URL which I think matches the route:
Here is the function skeleton:
public function newsArticleAction($id, $slug)
{
}
What am I missing here? I get a 500 error and the log says:
[2012-10-30 20:36:35] request.INFO: Matched route "newsarticle" (parameters: "_controller": "App\SiteBundle\Controller\DefaultController::newsArticleAction", "id": "202", "slug": "my-news-title", "_route": "newsarticle") [] [] [2012-10-30 20:36:36] app.INFO: From listener: The "newsarticle" route has some missing mandatory parameters ("id"). [] [] [2012-10-30 20:36:36] request.CRITICAL: Symfony\Component\Routing\Exception\MissingMandatoryParametersException: The "newsarticle" route has some missing mandatory parameters ("id"). (uncaught exception) at /home/user/app/cache/prod/classes.php line 676 [] []
newsarticle
and doesn't have all the required params to generate it, to which it will throw this exact exception. – noetix