Error when trying to install sonata admin in symfony 4

前端 未结 2 785
轻奢々
轻奢々 2021-01-23 08:15

I try to install sonata admin user bundle in symfony 4 project:

composer create-project symfony/website-skeleton my-project
composer require sonata-project/admin         


        
相关标签:
2条回答
  • 2021-01-23 09:00

    One of the differences between S3 and S4 is that the framework itself no longer has any template engines by default. The usual twig stuff still works as long as you have installed the website-skeleton or manually installed twig. But still no templating service.

    You need to:

    composer require templating
    

    And then set the templating engine in your framework config:

    # config/packages/framework.yaml
    templating:
        engine: 'twig'
    

    After that you can verify that you have a templating service with bin/console debug:container

    And though I don't use the sonata admin bundle myself, it seems to install cleanly at least.

    Bit of a mystery as to why the template recipe is not installed as part of the website-skeleton. But oh well.

    0 讨论(0)
  • 2021-01-23 09:18

    There is already an issue reported on their github, you can find the solution to your problem here :

    https://github.com/sonata-project/SonataAdminBundle/issues/4910#issuecomment-360587312

    0 讨论(0)
提交回复
热议问题