Jake Bunce
Well-known member
In my addon I want to add the same _postDispatch to multiple controllers. This would be my listener:
I encountered a problem where I get a redeclaration error if multiple of those controllers are used in a single execution. My solution was to simply duplicate my extended class for each controller. But ideally I would like to have just one generic extended class for all of them.
Can this redeclaration error be addressed internally? Or can anyone suggest another method to avoid having to duplicate my extended class?
Code:
if (in_array($class, array(
'XenForo_ControllerPublic_Page',
'XenForo_ControllerPublic_Forum',
'XenForo_ControllerPublic_Category',
'XenForo_ControllerPublic_LinkForum',
'XenForo_ControllerPublic_Thread',
'XenForo_ControllerPublic_Post'
)))
{
$extend[] = 'NodesAsTabs_ControllerPublic_Generic';
}
I encountered a problem where I get a redeclaration error if multiple of those controllers are used in a single execution. My solution was to simply duplicate my extended class for each controller. But ideally I would like to have just one generic extended class for all of them.
Can this redeclaration error be addressed internally? Or can anyone suggest another method to avoid having to duplicate my extended class?