getUri()->getQuery(), $args); $uri = '/'; if (isset($args['page'])) { $uri .= $args['page']; } return $this->createDispatcher()->dispatch( $request->getMethod(), $uri ); } /** * Build the path for a named route including the base path * * @param string $name Route name * @param array $data Named argument replacement data * @param array $queryParams Optional query string parameters * * @return string * * @throws \RuntimeException If named route does not exist * @throws \InvalidArgumentException If required data not provided */ public function pathFor($name, array $data = [], array $queryParams = []) { $url = str_replace('/', '/?page=', $this->relativePathFor($name, $data, $queryParams)); if ($this->basePath) { $url = $this->basePath . $url; } return $url; } }