简体   繁体   中英

Sonata Seo Bundle in Symfony 4

I've installed Sonata Seo Bundle in a Symfony 4 project and I have followed the steps from https://sonata-project.org/bundles/seo/2-x/doc/reference/usage.html . But when I launch the application I take this fatal error:

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.

I found just now a solution that work fine the Seo Bundle.

Just, in config/service.yaml file I add:

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

Previously I have this in the same file:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM