Skip to content

Problem on https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us//ApiOverview/Backend/BackendModules/DocHeaderComponent.html #6296

@metapublic-gbr

Description

@metapublic-gbr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions