Skip to content

Commit

Permalink
Merge pull request #51 from koriym/route-generate
Browse files Browse the repository at this point in the history
RouterInterface::generate() for reverse route match
  • Loading branch information
koriym committed Jan 20, 2015
2 parents 28219f7 + fc39ed0 commit 8994f80
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Extension/Router/RouterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ interface RouterInterface extends ExtensionInterface
* @return RouterMatch
*/
public function match(array $globals, array $server);

/**
* @param string $name The route name to look up.
* @param array $data The data to interpolate into the URI; data keys map to param tokens in the path.
*
* @return mixed Returns a URI when it finds a name, or boolean false if there is no route name.
*/
public function generate($name, $data);
}
8 changes: 8 additions & 0 deletions src/Provide/Router/WebRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ public function match(array $globals, array $server)

return $request;
}

/**
* {@inheritdoc}
*/
public function generate($name, $data)
{
return false;
}
}

0 comments on commit 8994f80

Please sign in to comment.