FOSRestBundle doesn't work in Symfony 4.1

后端 未结 4 2049
无人共我
无人共我 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:06

    Templating component integration is deprecated in Symfony 4.3. So templating section must be removed (or commented) from config/packages/framework.yaml

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

    To define Twig as templating service in ViewHandler add lines below to config/services.yaml

        fos_rest.templating:
            alias: twig

提交回复
热议问题