Пример #1
0
 /**
  * @expectedException \UnexpectedValueException
  */
 public function testGetUrlTemplateWhiteSpaces()
 {
     $generator = new UrlGenerator();
     $template = '/:categories/:title';
     $placeholders = [':categories' => 'tech/news', ':title' => 'new gadget'];
     $generator->getUrl($template, $placeholders);
 }
Пример #2
0
 /**
  * @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;
 }
Пример #3
0
 /**
  * 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;
 }
Пример #4
0
 /**
  * @return string
  */
 private function getRelativeURL()
 {
     $generator = new UrlGenerator();
     $url = $generator->getUrl($this->getUrlTemplate(), $this->getUrlPlaceholders());
     return $url;
 }