Ferdinand Kuhl
91e8899a37
Adjusts code to package renaming from "TYPO3.Fluid" to "Neos.FluidAdaptor".
42 lines
980 B
PHP
42 lines
980 B
PHP
<?php
|
|
namespace DigiComp\Menu\ViewHelpers;
|
|
|
|
/*
|
|
* This file is part of the DigiComp.Menu package.
|
|
*
|
|
* (c) digital competence
|
|
*
|
|
* This package is Open Source Software. For the full copyright and license
|
|
* information, please view the LICENSE file which was distributed with this
|
|
* source code.
|
|
*/
|
|
|
|
use Neos\Flow\Annotations as Flow;
|
|
use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper;
|
|
|
|
/**
|
|
* Just adds the return of MenuService
|
|
* TODO: Write example
|
|
*/
|
|
class MenuViewHelper extends AbstractViewHelper
|
|
{
|
|
|
|
protected $escapeOutput = false;
|
|
|
|
/**
|
|
* @var \DigiComp\Menu\MenuService\ServiceInterface
|
|
* @Flow\Inject
|
|
*/
|
|
protected $menuService;
|
|
|
|
/**
|
|
* @param string $as
|
|
* @param string $forPath
|
|
* @return string
|
|
*/
|
|
public function render($as = 'menuItems', $forPath = null)
|
|
{
|
|
$this->templateVariableContainer->add($as, $this->menuService->getItems($forPath));
|
|
return $this->renderChildren();
|
|
}
|
|
}
|