From d78f45d9bb35e81adcf714489ac11efceba7d1b1 Mon Sep 17 00:00:00 2001 From: Martin Kutschker Date: Tue, 24 Dec 2024 07:36:54 +0100 Subject: [PATCH] Update CreateModuleWithExtbase.rst - rendering example is broken (#5150) ModuleTemplate->setContent() does not exist. It comes with its own view. --- .../HowTo/BackendModule/CreateModuleWithExtbase.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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'); }