Util/BlockUtils.php
public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
    {
        $pathName  = null !== $prefix ? $prefix . '_path' : 'path';
        $routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
        if ($options->isExistsAndNotEmpty($pathName)) {
            $view->vars[$pathName] = $options[$pathName];
        } elseif ($options->isExistsAndNotEmpty($routeName)) {
            $view->vars[$routeName] = $options[$routeName];

            $routeParamName              = null !== $prefix ? $prefix . '_route_parameters' : 'route_parameters';
            $view->vars[$routeParamName] = isset($options[$routeParamName])
                ? $options[$routeParamName]
                : [];
        } elseif ($required) {
            throw new MissingOptionsException(
                sprintf('Either "%s" or "%s" must be set.', $pathName, $routeName)
            );
        }
    }
public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
    {
        $pathName  = null !== $prefix ? $prefix . '_path' : 'path';
        $routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
        if ($options->isExistsAndNotEmpty($pathName)) {
            $view->vars[$pathName] = $options[$pathName];
        } elseif ($options->isExistsAndNotEmpty($routeName)) {
            $view->vars[$routeName] = $options[$routeName];

            $routeParamName              = null !== $prefix ? $prefix . '_route_parameters' : 'route_parameters';
            $view->vars[$routeParamName] = isset($options[$routeParamName])
                ? $options[$routeParamName]
                : [];
        } elseif ($required) {
            throw new MissingOptionsException(
                sprintf('Either "%s" or "%s" must be set.', $pathName, $routeName)
            );
        }
    }
public static function processUrl ( BlockView $ view , Options $ options , $ required = false , $ prefix = null ) { $ pathName = null !== $ prefix ? $ prefix . '_path' : 'path' ; $ routeName = null !== $ prefix ? $ prefix . '_route_name' : 'route_name' ; if ( $ options -> isExistsAndNotEmpty ( $ pathName ) ) { $ view -> vars [ $ pathName ] = $ options [ $ pathName ] ; } elseif ( $ options -> isExistsAndNotEmpty ( $ routeName ) ) { $ view -> vars [ $ routeName ] = $ options [ $ routeName ] ; $ routeParamName = null !== $ prefix ? $ prefix . '_route_parameters' : 'route_parameters' ; $ view -> vars [ $ routeParamName ] = isset ( $ options [ $ routeParamName ] ) ? $ options [ $ routeParamName ] : [ ] ; } elseif ( $ required ) { throw new MissingOptionsException ( sprintf ( 'Either "%s" or "%s" must be set.' , $ pathName , $ routeName ) ) ; } }
Gets the url related options and pass them to the block view.

@param BlockView   $view     The block view
@param Options     $options  The block options
@param boolean     $required Specifies whether the url related options are mandatory
@param string|null $prefix   The prefix for the url related options

@SuppressWarnings(PHPMD.NPathComplexity)
Gets the url related options and pass them to the block view .