Last active
August 29, 2015 14:16
-
-
Save davefreiman/ea5d0324ce974be2b98f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieve route URL | |
* | |
* @param string $routePath | |
* @param array $routeParams | |
* | |
* @return string | |
*/ | |
public function getRouteUrl($routePath = null, $routeParams = null) | |
{ | |
$this->unsetData('route_params'); | |
if (isset($routeParams['_direct'])) { | |
if (is_array($routeParams)) { | |
$this->setRouteParams($routeParams, false); | |
} | |
return $this->getBaseUrl() . $routeParams['_direct']; | |
} | |
if (!is_null($routePath)) { | |
$this->setRoutePath($routePath); | |
} | |
if (is_array($routeParams)) { | |
$this->setRouteParams($routeParams, false); | |
} | |
$url = $this->getBaseUrl() . $this->getRoutePath($routeParams); | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment