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

package Default
inherited_from \Zend\View\Helper\AbstractHelper

 Methods

Generates a url given the name of a route.

__invoke(string $name = null, array $params = array(), array|\Traversable $options = array(), boolean $reuseMatchedParams = false) : string
see

Parameters

$name

string

Name of the route

$params

array

Parameters for the link

$options

array\Traversable

Options for the route

$reuseMatchedParams

boolean

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\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Set route match returned by the router.

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

Parameters

$routeMatch

\Zend\Mvc\Router\RouteMatch

Returns

\Zend\View\Helper\Url

Set the router to use for assembling.

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

Parameters

$router

\Zend\Mvc\Router\RouteStackInterface

Returns

\Zend\View\Helper\Url

Set the View object

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

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

 Properties

 

RouteInterface match returned by the router.

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

Default

 

RouteStackInterface instance.

$router : \Zend\Mvc\Router\RouteStackInterface

Default

 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null