Closed tdumalin closed 2 years ago
Seems like you already had this idea https://github.com/sonata-project/SonataAdminBundle/issues/6551 Maybe it's better to open the previous issue instead, WDYT ?
This could be great to have a way to avoid using config file.
Feel free to provide a PR.
Yes that's true i already have opened an issue for this, but this time I manage to make it work! You are right i will reopen the old one and make a PR when i have some free time that seems a better idea.
Thanks
Feature Request
Hi,
I think it would be a good idea that Admin implements ServiceSubscriberInterface and use symfony autoConfigure https://symfony.com/doc/current/service_container/service_subscribers_locators.html
With those two features admin can be created without any configuration file, and any service can be injected easily.
Here is my personal implementation to make it possible:
namespace App\Admin;
interface AutoConfiguredAdminInterface { public static function getDefaultConfig(): array; }
That's it, now any service that extends AbstractAdmin doesn't need any configuration !