【问题标题】:Sonata Seo Bundle in Symfony 4Symfony 4 中的奏鸣曲 Seo Bundle
【发布时间】:2018-10-15 06:00:29
【问题描述】:

我已经在 Symfony 4 项目中安装了 Sonata Seo Bundle,并按照https://sonata-project.org/bundles/seo/2-x/doc/reference/usage.html 中的步骤进行操作。但是当我启动应用程序时,我遇到了这个致命错误:

The "sonata.seo.page" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

【问题讨论】:

    标签: sonata symfony4


    【解决方案1】:

    我刚刚找到了一个可以在 Seo Bundle 中正常工作的解决方案。

    只是,我在 config/service.yaml 文件中添加:

    sonata.seo.page:
        class: Sonata\SeoBundle\Seo\SeoPage
    

    以前我在同一个文件中有这个:

    services:
        _defaults:
            autowire: true
            autoconfigure: true
            public: true
    

    【讨论】:

      猜你喜欢
      • 2018-12-08
      • 2019-01-18
      • 2018-01-09
      • 2020-12-08
      • 1970-01-01
      • 2018-02-24
      • 2018-03-22
      • 1970-01-01
      • 2018-06-18
      相关资源
      最近更新 更多