Is there a way to dynamically change the template ...
# help
r
Is there a way to dynamically change the template of tabItemTransfer (which is being set to tabsViewTransfer) ... depending a distinguishing var from with in add and edit controller (abstract product specifically) ? The
createView@AbstractTabs
method being called from controllers
Copy code
$this->getFactory()->createProductFormEditTabs()->createView()
offers us a abstract build method, but at the point of the build the only thing i have in hands is the
TabsViewTransfer $tabsViewTransfer
By introducing a plugin in here
Copy code
ProductManagementDependencyProvider

protected function getProductAbstractFormEditTabsExpanderPlugins(): array
{
    return [];
}
I can get the $tabsViewTransfer and manipulate it , but inside that plugin i still would need to know if I derived from add or edit controller any ideas how to work around that ? Thx a lot In other words somehow I need by overriding this method protected function
addImageTab(TabsViewTransfer $tabsViewTransfer)
to set a specific template depending a variable from controller. Is there a way to get form container everything about the current request ? maybe i could distinguish inside that plugin from the request object ? I guess I can get the request from with in factory like this
Copy code
$this->getRequestStack()->getCurrentRequest();
g
why don’t you pass the value from controller to the user session transfer and then get it in the plugin? if you really need to know who is the caller inside the plugin. imo this is not so good architecture.