MenuContentObjectFactory

class \TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory

Implements
SingletonInterface

Factory for menu content objects. Allows overriding the default types like 'TMENU' with an own implementation (only one possible) and new types can be registered.

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$menuTypeToClassMapping  : array
Register of TypoScript keys to according render class

Methods

getMenuObjectByType()  : AbstractMenuContentObject
Gets a typo script string like 'TMENU' and returns an object of this type
registerMenuType()  : mixed
Register new menu type or override existing type

Properties

$menuTypeToClassMapping

Register of TypoScript keys to according render class

protected array $menuTypeToClassMapping = ['TMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\TextMenuContentObject::class]

Methods

registerMenuType()

Register new menu type or override existing type

public registerMenuType(string $type, string $className) : mixed

Parameters

$type : string

Menu type to be used in TypoScript

$className : string

Class rendering the menu

On this page