Пример #1
0
 /**
  * Returns a url object that may be parametrized further and that
  * is automatically converted to a url string when it is printed.
  *
  * @param string $action
  * @param string $controller
  * @param string $module
  * @return Mol_View_Helper_Value_Url
  */
 public function to($action, $controller, $module = 'default')
 {
     $url = new Mol_View_Helper_Value_Url($this->view);
     $url->withParam('action', $action);
     $url->withParam('controller', $controller);
     $url->withParam('module', $module);
     $url->withRoute('default');
     return $url;
 }
Пример #2
0
 /**
  * Tests if the url contains all provided parameters.
  */
 public function testUrlContainsAllAddedParams()
 {
     $this->url->withParam('firstName', 'Matthias');
     $this->url->withParam('lastName', 'Molitor');
     $url = (string) $this->url;
     // Ensure that the url contains the parameter values.
     $this->assertContains('Matthias', $url);
     $this->assertContains('Molitor', $url);
     // Ensure that the url contains the parameter names.
     $this->assertContains('firstName', $url);
     $this->assertContains('lastName', $url);
 }