‪TYPO3CMS  9.5
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 'GMENU' 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 26 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.

Referenced by TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Menu\MenuContentObjectFactoryTest\getMenuObjectByTypeThrowsExceptionForUnknownType().

◆ registerMenuType()

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

Member Data Documentation

◆ $menuTypeToClassMapping

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

Register of TypoScript keys to according render class

Definition at line 32 of file MenuContentObjectFactory.php.