小编mat*_*464的帖子

Symfony 4中没有服务FOSJsRoutingBundle

错误:

An exception has been thrown during the rendering of a template 

"You have requested a non-existent service "C". Did you mean one of
these: "Symfony\Bundle\FrameworkBundle\Controller\RedirectController",
"Symfony\Bundle\FrameworkBundle\Controller\TemplateController
Run Code Online (Sandbox Code Playgroud)

如何在symfony 4中打开FOSJsRoutingBundle?

bundles.php:

FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true] 
Run Code Online (Sandbox Code Playgroud)

routes.yaml:

fos_js_routing:
    resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
Run Code Online (Sandbox Code Playgroud)

layout.html.twig:

<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>
Run Code Online (Sandbox Code Playgroud)

php bundle symfony

2
推荐指数
1
解决办法
2129
查看次数

标签 统计

bundle ×1

php ×1

symfony ×1