/** * Generate a URI from the named route. * * Takes the named route and any substitutions, and attempts to generate a * URI from it. * * @see https://github.com/auraphp/Aura.Router#generating-a-route-path * @see http://framework.zend.com/manual/current/en/modules/zend.mvc.routing.html * @param string $name * @param array $substitutions * @return string * @throws Exception\RuntimeException if unable to generate the given URI. */ public function generateUri($name, array $substitutions = []) { if (!$this->router->hasNamedRoute($name)) { throw new Exception\RuntimeException(sprintf('Cannot generate URI based on route "%s"; route not found', $name)); } return $this->router->urlFor($name, $substitutions); }