예제 #1
0
 /**
  * Get a route path by a given name
  * @param string $routeName
  * @param array $params (optional)
  * @return string
  */
 public final function urlFor($routeName, array $params = array())
 {
     if (null === $this->router) {
         return '';
     }
     return $this->router->urlFor($routeName, $params);
 }
예제 #2
0
 public function testUrlFor()
 {
     $this->assertEquals('/somewhere/{name}', $this->router->urlFor('index_name_not_same'));
     $this->assertEquals('/somewhere/foobar', $this->router->urlFor('index_name_not_same', array('name' => 'foobar')));
     // next test covers the 'temp' stored urls.
     $this->assertEquals('/somewhere/foobar', $this->router->urlFor('index_name_not_same', array('name' => 'foobar')));
     $this->assertEquals('missing_path', $this->router->urlFor('missing_path'));
 }