DigiComp.FluidJsonViews/Classes/ViewHelpers/FluidJsonViewHelper.php
Ferdinand Kuhl 7585baee36
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/4 Pipeline was successful
first working version in Flow 6.3
2024-06-02 02:33:19 +02:00

64 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace DigiComp\FluidJsonViews\ViewHelpers;
use DigiComp\FluidJsonViews\ViewHelpers\Controller\FluidJsonController;
use DigiComp\FluidRenderFunctions\InvokeRenderFunctionInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Exception\InfiniteLoopException;
use Neos\Flow\Mvc\Exception\StopActionException;
use Neos\Flow\Persistence\Doctrine\QueryResult;
use Neos\FluidAdaptor\Core\Widget\AbstractWidgetViewHelper;
use Neos\FluidAdaptor\Core\Widget\Exception\InvalidControllerException;
use Neos\FluidAdaptor\Core\Widget\Exception\MissingControllerException;
class FluidJsonViewHelper extends AbstractWidgetViewHelper
{
/**
* @inheritDoc
* @Flow\Inject
* @var FluidJsonController
*/
protected $controller;
/**
* @inheritDoc
*/
protected $ajaxWidget = true;
/**
* @inheritDoc
*/
public function initializeArguments(): void
{
parent::initializeArguments();
$this->registerArgument('objects', QueryResult::class, 'Objects to show in table.', true);
$this->registerArgument(
'renderFunction',
InvokeRenderFunctionInterface::class,
'callabe to use to render single object',
true
);
$this->registerArgument(
'searchProperties',
'array',
'an array of pathes, which should be used during search evaluation',
false,
[]
);
}
/**
* @throws InfiniteLoopException
* @throws InvalidControllerException
* @throws MissingControllerException
* @throws StopActionException
*/
public function render(): string
{
return $this->initiateSubRequest();
}
}