SonataAdminBundle
SonataAdminBundle copied to clipboard
Autoinject all admin variables
Subject
With this PR it is not necessary to use the CRUDController::renderWithExtraParams to render a template in the admin context. All admin pages with a _sonata_admin parameter inside the route configuration can use the autoinjected twig variables for that admin page.
IMHO we can remove this method on the master branch after merging:
https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Controller/CRUDController.php#L932
I am targeting this branch, because this feature is BC.
Changelog
### Added
- Autoinject all admin variables using event listeners
Subject
With this PR it is not necessary to use the
CRUDController::renderWithExtraParamsto render a template in the admin context. All admin pages with a_sonata_adminparameter inside the route configuration can use the autoinjected twig variables for that admin page.
What if the method was overridden by someone ?
IMHO we can remove this method on the
masterbranch after merging: https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Controller/CRUDController.php#L932
What would be the way to override the base template then ? Should we add deprecation message and documentation ?
This PR 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.
Should we add a next major comment to remove the code inside addRenderExtraParams ?
Probably other bundles should adapt the implementation to not use this method too, imo we should remove it.
Do we have tests covering this new class?
Do you have time to finish this PR @core23 ?
This PR 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.