FOSRestBundle doesn't work in Symfony 4.1

后端 未结 4 2051
无人共我
无人共我 2021-02-20 12:52

I have problem with returning views with FOSRestBundle working under Symfony 4.1 Project.

This is code from my controller:

class NewsController extends          


        
4条回答
  •  渐次进展
    2021-02-20 13:18

    Add line to config/packages/framework.yaml

    framework:
        templating: { engines: ['twig'] }
    

    it will solve

    An instance of Symfony\Bundle\FrameworkBundle\Templating\EngineInterface >must be injected in FOS\RestBundle\View\ViewHandler to render templates.

提交回复
热议问题