Hazaar\Application
Url
Generate a URL relative to the application

This is the base method for generating URLs in your application. URLs generated directly from here are relative to the application base path. For URLs that are relative to the current controller see Controller::url()

Parameters are dynamic and depend on what you are trying to generate.

For examples see "Generating URLs":http://www.hazaarmvc.com/docs/the-basics/generating-urls in the Hazaar MVC support documentation.

Summary
MethodsPropertiesConstants
No constants
Properties
Static
$aliases
$aliases
Static
$base
$base
$base_path
$base_path
$controller
$controller
$encoded
$encoded
$hash
$hash
$method
$method
$params
$params
$path
$path
Static
$rewrite
$rewrite
Methods
__construct()
__construct()
__tostring()
__tostring()

Magic method to output a string URL.

encode()
encode($encode = true)
renderObject()
renderObject($inc_path = true, $params = null, $encode = false) : string
Write the URL as a string
renderPath()
renderPath()
setParams()
setParams($params, $merge = false)
Set the HTTP request parameters on the URL
toString()
toString($values = null) : string
Write the URL as a string

This method optionally takes an array to use to filter any placeholder parameters. Parameters support special placholder values that are prefixed with a '$', such as $name. The actual value is then taken from the array supplied to this method and replaced in the output. This allows a single URL object to be used multiple times and it's parameters changed

Example:

$url = new \Hazaar\Application\Url('controller', 'action', array('id' => '$id')); echo $url->toString(array('id' => 1234));

This will output something like: @http://localhost/controller/action?id=1234@