NavigationItem: Allow to set and get single url parameters

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-03 09:56:02 +02:00
parent 1fb5c96ef1
commit a626e8f7fb
1 changed files with 28 additions and 0 deletions

View File

@ -424,6 +424,34 @@ class NavigationItem implements IteratorAggregate
return $this;
}
/**
* Return the value of the given url parameter
*
* @param string $name
* @param mixed $default
*
* @return mixed
*/
public function getUrlParameter($name, $default = null)
{
$parameters = $this->getUrlParameters();
return isset($parameters[$name]) ? $parameters[$name] : $default;
}
/**
* Set the value of the given url parameter
*
* @param string $name
* @param mixed $value
*
* @return $this
*/
public function setUrlParameter($name, $value)
{
$this->urlParameters[$name] = $value;
return $this;
}
/**
* Return all additional parameters for this item's url
*