This example given on this page is incomplete:
Usage in a controller:
public function __construct(
protected readonly ComponentFactory $componentFactory,
) }
public function myAction(): ResponseInterface
{
$view = $this->moduleTemplateFactory->create($request);
$docHeader = $view->getDocHeaderComponent();
// Set breadcrumb for a page
$docHeader->setPageBreadcrumb($pageInfo);
// Add action buttons using ComponentFactory
$buttonBar = $docHeader->getButtonBar();
$saveButton = $this->componentFactory->createSaveButton('editform');
$buttonBar->addButton($saveButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
}
Problem 1: "ComponentFactory" is not found in TYPO3 13
Problem 2: "$pageInfo" is not defined.
Like this, the example is not helpful.
Unfortunately, I don't know the matter, so I can propose a better solution.