Skip to content

Commit

Permalink
add fragment argument to alias method, #282
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Aug 26, 2019
1 parent 2ea8b9a commit 0d49e15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1389,16 +1389,17 @@ function mock($pattern,
* @param $name string
* @param $params array|string
* @param $query string|array
* @param $fragment string
**/
function alias($name,$params=[],$query=NULL) {
function alias($name,$params=[],$query=NULL,$fragment=NULL) {
if (!is_array($params))
$params=$this->parse($params);
if (empty($this->hive['ALIASES'][$name]))
user_error(sprintf(self::E_Named,$name),E_USER_ERROR);
$url=$this->build($this->hive['ALIASES'][$name],$params);
if (is_array($query))
$query=http_build_query($query);
return $url.($query?('?'.$query):'');
return $url.($query?('?'.$query):'').($fragment?'#'.$fragment:'');
}

/**
Expand Down

0 comments on commit 0d49e15

Please sign in to comment.