FIX: First steps towards Flow 6.3 compatibility. For now only ItemsViewHelper

This commit is contained in:
Ferdinand Kuhl 2020-10-15 21:13:20 +02:00
parent ac808d34d6
commit 893e6b313a
2 changed files with 12 additions and 4 deletions

View file

@ -29,14 +29,21 @@ class ItemsViewHelper extends AbstractViewHelper
*/ */
protected $menuService; protected $menuService;
public function initializeArguments(): void
{
$this->registerArgument('for', 'string', 'path in Menu.yaml', false);
$this->registerArgument('as', 'string', 'Name in Frontend', false);
}
/** /**
* @param string $as
* @param string $for
* @return string * @return string
*/ */
public function render($as = 'items', $for = null) public function render(): string
{ {
$this->templateVariableContainer->add($as, $this->menuService->getItems($for)); $this->templateVariableContainer->add(
$this->arguments['as'],
$this->menuService->getItems($this->arguments['for'])
);
return $this->renderChildren(); return $this->renderChildren();
} }
} }

View file

@ -22,6 +22,7 @@ class ProgressViewHelper extends AbstractViewHelper
protected $escapeOutput = false; protected $escapeOutput = false;
/** /**
* TODO: initializeArguments
* @param array $links * @param array $links
* @param int $activeStep * @param int $activeStep
* @param bool $returnable * @param bool $returnable