From 14d07acbe3f8e35ae2e92cf14a90bd9a6778a53c Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:51:11 +0100 Subject: [PATCH] Update CreateModuleWithExtbase.rst - rendering example is broken (#5150) (#5160) ModuleTemplate->setContent() does not exist. It comes with its own view. Co-authored-by: Martin Kutschker --- .../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'); }