TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\ContentObject\Menu\MenuContentObjectFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

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

Protected Attributes

 $menuTypeToClassMapping
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! 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.

Author
Christian Kuhn lolli.nosp@m.@sch.nosp@m.warzb.nosp@m.u.ch

Definition at line 24 of file MenuContentObjectFactory.php.

Member Function Documentation

◆ getMenuObjectByType()

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
object Menu object
Exceptions
Exception

Definition at line 45 of file MenuContentObjectFactory.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ 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$classNameClass rendering the menu
Exceptions

Definition at line 65 of file MenuContentObjectFactory.php.

Member Data Documentation

◆ $menuTypeToClassMapping

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

Definition at line 31 of file MenuContentObjectFactory.php.