FOSJsRoutingBundle dont recognize route

javascript, symfony, url-routing

Solution

Your code is great.

I suggest that you open an issue here, this is very likely to be a bug as you're not the only one to have that issue.

Problem

I'm trying use `FOSJsRoutingBundle` to generate urls from symfony routes. I follow the doc. I include the files into my `base.html.twig`: ``` {% block scripting %} ... <script type="text/javascript" src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script> <script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script> ... {% endblock %} ``` And don't get inclusion error. But the try to generate an url fails: ``` console.log(Routing.generate('usuarios_crear')); ``` GET http://appsmanantiales.local/web/app_dev.php/js/routing?callback=fos.Router.setData 500 (Internal Server Error) listar:131 Uncaught Error: The route "usuarios_crear" does not exist. router.js:9 In my `routing.yml` I have: ``` usuarios_crear: pattern: /AbmUsuarios/crear defaults: { _controller: AbmBundle:Usuario:crear } options: expose: true ``` And the route is in `php app/console fos:js-routing:debug` list: usuarios_crear ANY ANY ANY /AbmUsuarios/crear Any ideas?

Original source

Related problems