2014-07-07 15:49:44 +02:00
|
|
|
<?php
|
|
|
|
namespace DigiComp\Menu\ViewHelpers;
|
|
|
|
/* *
|
|
|
|
* This script belongs to the FLOW3 package "DigiComp.Controls". *
|
|
|
|
* *
|
|
|
|
* */
|
|
|
|
use TYPO3\Flow\Annotations as Flow;
|
|
|
|
/**
|
|
|
|
* Renders the sum of given collection and property name
|
|
|
|
*/
|
|
|
|
class MenuViewHelper extends \TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper {
|
|
|
|
|
2015-06-15 16:48:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NOTE: This property has been introduced via code migration to ensure backwards-compatibility.
|
|
|
|
* @see AbstractViewHelper::isOutputEscapingEnabled()
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $escapeOutput = FALSE;
|
|
|
|
|
2014-07-07 15:49:44 +02:00
|
|
|
/**
|
|
|
|
* @var \DigiComp\Menu\MenuService\ServiceInterface
|
|
|
|
* @Flow\Inject
|
|
|
|
*/
|
|
|
|
protected $menuService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $as
|
|
|
|
* @param string $forPath
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function render($as = 'menuItems', $forPath = NULL) {
|
|
|
|
$this->templateVariableContainer->add($as, $this->menuService->getItems($forPath));
|
|
|
|
return $this->renderChildren();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|