Feature: #92358 - Add getModuleTemplate() to PageLayoutController

See Issue #92358


The PageLayoutController features two hooks for manipulating the Page module. drawHeaderHook and drawFooterHook. Those hooks already receive the parent object PageLayoutController. Since the calling code expects the hooks to return additional content, it was previously not possible to change other parts of the module, e.g. the module header.

To give developers more possibilities in manipulating the page module, using the mentioned hooks, the parent object now contains a new getter method getModuleTemplate(). It can for example be used to add an additional button to the modules’ button bar.

public function drawHeaderHook(array $parameters, PageLayoutController $parentObject)
   $moduleTemplate = $parentObject->getModuleTemplate();
   $buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();

   $linkButton = $buttonBar
      ->setTitle('My custom button')
      ->setIcon($moduleTemplate->getIconFactory()->getIcon('actions-link', Icon::SIZE_SMALL));



When using either the drawHeaderHook or the drawFooterHook of the PageLayoutController, the provided parent object now contains the getModuleTemplate() method, which can be used to retrieve the corresponding ModuleTemplate instance. This provides more flexibility to 3rd party code manipulating the page module view.