/** * @expectedException \UnexpectedValueException */ public function testGetUrlTemplateWhiteSpaces() { $generator = new UrlGenerator(); $template = '/:categories/:title'; $placeholders = [':categories' => 'tech/news', ':title' => 'new gadget']; $generator->getUrl($template, $placeholders); }
/** * @return string */ private function getPageRelativeUrl($page) { $result = false; if ($page) { $generator = new UrlGenerator(); $template = $this->configuration->getRepository()->get('paginate_path'); $result = $generator->getUrl($template, [':num' => $page]); } return $result; }
/** * Get the relative URL. e.g. /about/me.html * * @return string */ public function getUrl() { $generator = new UrlGenerator(); $url = $generator->getUrl($this->getUrlTemplate(), $this->getUrlPlaceholders()); return $url; }
/** * @return string */ private function getRelativeURL() { $generator = new UrlGenerator(); $url = $generator->getUrl($this->getUrlTemplate(), $this->getUrlPlaceholders()); return $url; }