Exemple #1
0
 /**
  * When you need to send a not found in your runnable, you
  * can call this directly.
  * Optionally, you can specify the package name, class name,
  * and method name to render accordingly.
  * @param sring $package (optional) default 'DefaultPackage'
  * @param sring $class (optional) default 'Error'
  * @param sring $method (optional) default 'notFound'
  * @return void
  */
 public function notFound($package = 'DefaultPackage', $class = 'Error', $method = 'notFound')
 {
     $this->response->setStatus(404);
     $this->view->setPackage($package);
     $this->view->setClass($class);
     $this->view->setScriptName($method);
     return;
 }
Exemple #2
0
 public function testGetUrl()
 {
     $this->assertEmpty($this->view->urlFor('abc.123'));
     $this->view->setRouter(new Router());
     $this->assertEquals('abc.123', $this->view->urlFor('abc.123'));
 }
Exemple #3
0
 /**
  * Retrieve an instance of View for a given package, class, method combination
  * @param string $package
  * @param string $class
  * @param string $method
  * @return \Phavour\Runnable\View
  */
 private function getViewFor($package, $class, $method)
 {
     $view = new View($this, $package, $class, $method);
     $view->setRouter($this->router);
     $view->setConfig($this->config);
     return $view;
 }