‪TYPO3CMS  10.4
TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

AbstractMenuContentObject getMenuObjectByType ($type='')
 
 registerMenuType ($type, $className)
 

Protected Attributes

array $menuTypeToClassMapping
 

Detailed Description

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.

this is only used for internal purposes and solely used for EXT:frontend and not part of TYPO3's Core API.

Definition at line 28 of file MenuContentObjectFactory.php.

Member Function Documentation

◆ getMenuObjectByType()

AbstractMenuContentObject TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory::getMenuObjectByType (   $type = '')

Gets a typo script string like 'TMENU' and returns an object of this type

Parameters
string$type
Returns
AbstractMenuContentObject Menu object
Exceptions
Exception

Definition at line 45 of file MenuContentObjectFactory.php.

◆ registerMenuType()

TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory::registerMenuType (   $type,
  $className 
)

Register new menu type or override existing type

Parameters
string$typeMenu type to be used in TypoScript
string$className‪Class rendering the menu
Exceptions

Definition at line 67 of file MenuContentObjectFactory.php.

Member Data Documentation

◆ $menuTypeToClassMapping

array TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory::$menuTypeToClassMapping
protected
Initial value:
= array(
'TMENU' => TextMenuContentObject::class,
)

Register of TypoScript keys to according render class

Definition at line 34 of file MenuContentObjectFactory.php.