/** * Get vault specific uri. * * @param string $target Target controller and action in a form of "controller::action" or * "controller:action" or "controller". * @param array|mixed $parameters * @return UriInterface * @throws VaultException */ public function uri($target, $parameters = []) { $target = str_replace('::', ':', $target); $controller = $action = ''; if (strpos($target, ':') !== false) { list($controller, $action) = explode(':', $target); } else { $controller = $target; if (!empty($parameters)) { throw new VaultException("Unable to generate uri with empty controller action and not empty parameters."); } } if (!isset($this->config->controllers()[$controller])) { throw new VaultException("Unable to generate uri, undefined controller '{$controller}'."); } $parameters['controller'] = $controller; $parameters['action'] = $action; return $this->route->uri($parameters, $this->httpConfig->basePath()); }