I try to use javascript routing in Symfony according to this tutorial: https://symfony.com/doc/master/bundles/FOSJsRoutingBundle/usage.html
Here is my code:
...
"render": function (data, type, row, meta) {
return Routing.generate('get-file', { fileId: data });
}
...
Amd the scripts:
<script src="{{ asset('bundles/fosjsrouting/js/router.min.js') }}"></script>
<script src="{{ path('get-file', { callback: 'fos.Router.setData' }) }}"></script>
<script>
const routes = require('../../public/js/fos_js_routes.json');
import Routing from '../../vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.min.js';
Routing.setRoutingData(routes);
Routing.generate('rep_log_list');
</script>
But I get the error:
An exception has been thrown during the rendering of a template ("Some mandatory parameters are missing ("fileId") to generate a URL for route "get-file".").