You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any reason why there is no method to get DashboardControllerInstance in AdminContext? Currently, we can get the Fqcn of dashboard controller, and then use the ControllerFactory but IMO it is way to much.
Short description of what this feature will allow to do:
I need to create a custom "DETAIL" page for my entity. I want to use actions that are defined in CrudController but in the template that is rendered by the normal Symfony controller.
My idea is to call configureActions from CrudController inside my normal Symfony controller.
What I am missing right now is the easy way of receiving the default Actions config.
Ok, I can copy the configureActions from AbstractDashboardController but it's quite ugly solution. My current idea is to call configureActions on my target CrudController, but the hardest part is to get the instance of the dashboard controller.
Below I show some ugly code, how it could be achieved.
Also, it might be good to add an option to pass a custom page name to ActionFactory::processEntityActions
- public function processEntityActions(EntityDto $entityDto, ActionConfigDto $actionsDto, ?string pageName = null): void- public function processEntityActions(EntityDto $entityDto, ActionConfigDto $actionsDto): void
{
+ $currentPage = $pageName ?: $this->adminContextProvider->getContext()->getCrud()->getCurrentPage(); - $currentPage = $this->adminContextProvider->getContext()->getCrud()->getCurrentPage();
//..
The there will be an option to define and use the same template and actions in standard Symfony controllers
teklakct
changed the title
method to get DashboardControllerInstance in AdminContext
method to get DashboardControllerInstance in AdminContext or using Crud actions in Symfony standard controller
Sep 21, 2024
TLDR;
Is there any reason why there is no method to get
DashboardControllerInstance
inAdminContext
? Currently, we can get the Fqcn of dashboard controller, and then use theControllerFactory
but IMO it is way to much.Short description of what this feature will allow to do:
I need to create a custom "DETAIL" page for my entity. I want to use actions that are defined in CrudController but in the template that is rendered by the normal Symfony controller.
My idea is to call
configureActions
from CrudController inside my normal Symfony controller.What I am missing right now is the easy way of receiving the default
Actions
config.Ok, I can copy the
configureActions
fromAbstractDashboardController
but it's quite ugly solution. My current idea is to callconfigureActions
on my target CrudController, but the hardest part is to get the instance of the dashboard controller.Below I show some ugly code, how it could be achieved.
Example of how to use this feature
and in the template
The text was updated successfully, but these errors were encountered: