Giter VIP home page Giter VIP logo

Comments (8)

gremo avatar gremo commented on July 1, 2024 2

LOL, you right, I added that line 👍

from sonataautoconfigurebundle.

kunicmarko20 avatar kunicmarko20 commented on July 1, 2024 1

https://github.com/kunicmarko20/SonataAutoConfigureBundle/releases/tag/0.6.0

from sonataautoconfigurebundle.

gremo avatar gremo commented on July 1, 2024

I disagree. I think that this is out of the scope of the bundle (guessing, making it global if no targets, etc.). IMHO we just need to "replicate" the behavior of the tag, with global and target attributes.

The target attribute of the tag seems wrong to me (but this is a SonataAdmin fault, of course) because most of the time, you'll use the configuration:

sonata_admin:
    extensions:
        app.publish.extension:
            admins:
                - app.admin.article
            implements:
                - App\Publish\PublishStatusInterface
            excludes:
                - app.admin.blog
                - app.admin.news
            extends:
                - App\Document\Blog
            instanceof:
                -  App\Document\Page
            uses:
                -  App\Trait\Timestampable

Mixing both target attribute and configuration will lead to a mess.

It is fine, as you say, to "guess" for entity and controller of an admin, but for extensions it seems wrong to me.

from sonataautoconfigurebundle.

kunicmarko20 avatar kunicmarko20 commented on July 1, 2024

I don't see a value in admin extension class that requires you to have annotation, then you can just register it as a service, it is not autoconfigured either way.

from sonataautoconfigurebundle.

gremo avatar gremo commented on July 1, 2024

I don't see a value in admin extension class that requires you to have annotation, then you can just register it as a service, it is not autoconfigured either way.

The annotation is only needed to make it global (and maybe configure the target), without repeating the service, as explained here #15

from sonataautoconfigurebundle.

kunicmarko20 avatar kunicmarko20 commented on July 1, 2024

Hm, ok, I can see the value in that, btw:

App\Admin\Extension\:
    resource: '../../src/Admin/Extension'
    tags: [{ name: 'sonata.admin.extension' }]

This is not needed anymore.

from sonataautoconfigurebundle.

gremo avatar gremo commented on July 1, 2024

This is not needed anymore.

Really? Why is not needed? The compiler pass do its stuff for services tagged with sonata.admin.extension: who is adding this tag? I think this code:

App\Admin\Extension\:
    resource: '../../src/Admin/Extension'
    tags: [{ name: 'sonata.admin.extension' }]

from sonataautoconfigurebundle.

kunicmarko20 avatar kunicmarko20 commented on July 1, 2024

https://github.com/kunicmarko20/SonataAutoConfigureBundle/blob/master/src/DependencyInjection/SonataAutoConfigureExtension.php#L47

from sonataautoconfigurebundle.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.