Contains function useful for working with URLs.
Loading the Helper
$uh = Loader::helper(‘url’);
Methods
$url = $uh->setVariable($variable, $value = false, $url = false)
Replaces certain request variables and appends them to an optional url (or uses $_SERVER[‘REQUEST_URI’] to generate a slightly modified search string. Useful when certain variables need to remain but a couple (like current page, etc…) need to change
Additional Arguments
- $variable - this can be either an associative array of variable keys/values that must change, or one variable key.
- $value - the value that this new variable, if only one is specified, must equal. If $variable is an array, $value should be blank ($variable will contain the $value for each parameter as well.)
- $url - The URL to append the built query string onto. If blank, $_SERVER[‘REQUEST_URI’] will be used.
$url = $uh->buildQuery($url, $params)
Runs http_build_query($params) and appends them to $url.
$imgurl = $uh->GetPackageIconURL($pkg)
Gets the package's icon and if it has none returns the generic icon.
Loading Conversation