sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Advanced extension tagging #6027

Closed core23 closed 2 years ago

core23 commented 4 years ago

Feature Request

I would like to contribute a new feature which will extend the registration of admin extensions.

At the moment you could only apply admin extensions by defining an extension config: https://github.com/sonata-project/SonataAdminBundle/blob/3.x/docs/reference/extensions.rst#configuration or you could tag admin services with global or target.

My idea is to add new attributes (extends, implements, ...) to sonata.admin.extension. So that all admin which extend a specific interface / extend a specific class / ... would use the extension.

        services:
            app.sortable.extension:
                class: App\Admin\Extension\SortableAdminExtension
                tags:
                    - { name: sonata.admin.extension, instanceof: 'Acme\Model\SortableInterface' }
VincentLanglet commented 4 years ago

I don't understand, according to the doc, it already exists: image

core23 commented 4 years ago

Some part are already possible. I want to create reusable bundles, so you have zero configuration.

The services configuration is not located inside your config folder, it is inside a bundle.

VincentLanglet commented 4 years ago

Some part are already possible. I want to create reusable bundles, so you have zero configuration.

The services configuration is not located inside your config folder, it is inside a bundle.

I see ! Your example helps me. Nice idea !

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

VincentLanglet commented 2 years ago

HI @core23, this has been stale for some times. Do you still work on this feature ?

core23 commented 2 years ago

The ExtensionCompilerPass is / was very clunky. I'll give it a new try this weekend after the most recent refactorings

VincentLanglet commented 2 years ago

Closing due to lack of interest