DigiComp.Menu/Classes/DigiComp/Menu/ViewHelpers/MenuViewHelper.php

38 lines
1.1 KiB
PHP
Raw Normal View History

<?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 {
/**
* NOTE: This property has been introduced via code migration to ensure backwards-compatibility.
* @see AbstractViewHelper::isOutputEscapingEnabled()
* @var boolean
*/
protected $escapeOutput = FALSE;
/**
* @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();
}
}
?>