Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Url Class Reference

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

Public Member Functions

 __invoke ($name=null, $params=[], $options=[], $reuseMatchedParams=false)
 Generates a url given the name of a route.
 
 setRouter ($router)
 Set the router to use for assembling.
 
 setRouteMatch ($routeMatch)
 Set route match returned by the router.
 
- Public Member Functions inherited from AbstractHelper
 setView (Renderer $view)
 Set the View object.
 
 getView ()
 Get the view object.
 

Protected Attributes

 $router
 
 $routeMatch
 
- Protected Attributes inherited from AbstractHelper
 $view = null
 

Detailed Description

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

Member Function Documentation

__invoke (   $name = null,
  $params = [],
  $options = [],
  $reuseMatchedParams = false 
)

Generates a url given the name of a route.

See Also
Zend::assemble()
Zend::assemble()
Parameters
string$nameName of the route
array$paramsParameters for the link
array | Traversable$optionsOptions for the route
bool$reuseMatchedParamsWhether to reuse matched parameters
Returns
string Url For the link href attribute
Exceptions
Exception\RuntimeExceptionIf no RouteStackInterface was provided
Exception\RuntimeExceptionIf no RouteMatch was provided
Exception\RuntimeExceptionIf RouteMatch didn't contain a matched route name
Exception\InvalidArgumentExceptionIf the params object was not an array or Traversable object.
setRouteMatch (   $routeMatch)

Set route match returned by the router.

Parameters
LegacyRouteMatch | RouteMatch$routeMatch
Returns
Url
setRouter (   $router)

Set the router to use for assembling.

Parameters
LegacyRouteStackInterface | RouteStackInterface$router
Returns
Url
Exceptions
Exception\InvalidArgumentExceptionfor invalid router types.

Member Data Documentation

$routeMatch
protected
$router
protected