Skip to content

Commit

Permalink
Merge pull request #215 from koriym/route
Browse files Browse the repository at this point in the history
no reverse route when no $values given
  • Loading branch information
koriym committed Mar 3, 2016
2 parents 9e4f116 + d314837 commit 9371e0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Provide/Representation/HalRenderer.php
Expand Up @@ -107,6 +107,9 @@ private function getReverseMatchedLink($uri)
$urlParts = parse_url($uri);
$routeName = $urlParts['path'];
isset($urlParts['query']) ? parse_str($urlParts['query'], $value) : $value = [];
if ($value === []) {
return $uri;
}
$reverseUri = $this->router->generate($routeName, (array) $value);
if (is_string($reverseUri)) {
return $reverseUri;
Expand Down

0 comments on commit 9371e0e

Please sign in to comment.