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

30 lines
No EOL
932 B
PHP

<?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 {
/**
* @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();
}
}
?>