diff --git a/Documentation/ExtensionArchitecture/HowTo/BackendModule/CreateModuleWithExtbase.rst b/Documentation/ExtensionArchitecture/HowTo/BackendModule/CreateModuleWithExtbase.rst index b4d96d188..6a096f72d 100644 --- a/Documentation/ExtensionArchitecture/HowTo/BackendModule/CreateModuleWithExtbase.rst +++ b/Documentation/ExtensionArchitecture/HowTo/BackendModule/CreateModuleWithExtbase.rst @@ -59,9 +59,11 @@ After that you can add titles, menus and buttons using :php:`ModuleTemplate`: // use Psr\Http\Message\ResponseInterface public function myAction(): ResponseInterface { - $this->view->assign('someVar', 'someContent'); $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + // Example of assignung variables to the view + $moduleTemplate->assign('someVar', 'someContent'); + // Example of adding a page-shortcut button $routeIdentifier = 'web_examples'; // array-key of the module-configuration $buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar(); @@ -70,7 +72,6 @@ After that you can add titles, menus and buttons using :php:`ModuleTemplate`: $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); // Adding title, menus and more buttons using $moduleTemplate ... - $moduleTemplate->setContent($this->view->render()); return $moduleTemplate->renderResponse('MyController/MyAction'); }