* @author Timo Hund */ class SetSortingViewHelper extends AbstractUriViewHelper { /** * Initializes the arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('sortingName', 'string', 'The sortingName', true); $this->registerArgument('sortingDirection', 'string', 'The sortingDirection', true); } /** * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $sortingName = $arguments['sortingName']; $sortingDirection = $arguments['sortingDirection']; $previousRequest = static::getUsedSearchRequestFromRenderingContext($renderingContext); $uri = self::getSearchUriBuilder($renderingContext)->getSetSortingUri($previousRequest, $sortingName, $sortingDirection); return $uri; } }