Helper for making easy links and getting urls that depend on the routes and router.

 Methods

Generates an url given the name of a route.

__invoke(string $name, array $params, array | \Traversable $options, bool $reuseMatchedParams) : string

see \Zend\Mvc\Router\RouteInterface::assemble()

Parameters

$name

string

Name of the route

$params

array

Parameters for the link

$options

array\Traversable

Options for the route

$reuseMatchedParams

bool

Whether to reuse matched parameters

Exceptions

\Zend\View\Exception\RuntimeException If no RouteStackInterface was provided
\Zend\View\Exception\RuntimeException If no RouteMatch was provided
\Zend\View\Exception\RuntimeException If RouteMatch didn't contain a matched route name
\Zend\View\Exception\InvalidArgumentException If the params object was not an array or \Traversable object

Returns

stringUrl For the link href attribute

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::getView()

Returns

Set route match returned by the router.

setRouteMatch(\Zend\Mvc\Router\RouteMatch $routeMatch) : \Zend\View\Helper\Url

Parameters

Returns

Set the router to use for assembling.

setRouter(\Zend\Mvc\Router\RouteStackInterface $router) : \Zend\View\Helper\Url

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::setView()

Parameters

Returns

 Properties

 

RouteInterface match returned by the router.

$routeMatch : \Zend\View\Helper\RouteMatch.

 

RouteStackInterface instance.

$router : \Zend\Mvc\Router\RouteStackInterface

 

View object instance

$view : \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::$$view