Example #1
0
 public function getDebug()
 {
     $d = new ZDummyController(Zoombi::getApplication(), '__dummy_ctl__');
     $o = $d->render(Zoombi::fromFrameworkDir('Views/view_route_debug.php'), array('route' => &$this), true);
     unset($d);
     return $o;
 }
 /**
  * Print html formated error message
  * @param int|arrray $a_code
  * @param string $a_message
  * @param int $a_line
  * @param string $a_file
  * @param array $a_backtrace
  * @return null
  */
 public function showError($a_code, $a_message = null, $a_line = null, $a_file = null, $a_backtrace = null)
 {
     if (is_array($a_code) && func_num_args() == 1) {
         return $this->showError(isset($a_code['code']) ? $a_code['code'] : null, isset($a_code['message']) ? $a_code['message'] : null, isset($a_code['line']) ? $a_code['line'] : null, isset($a_code['file']) ? $a_code['file'] : null, isset($a_code['backtrace']) ? $a_code['backtrace'] : null);
     } else {
         if ($a_code instanceof Exception) {
             return $this->showError($a_code->getCode(), $a_code->getMessage(), $a_code->getLine(), $a_code->getFile(), $a_code->getTrace());
         } else {
             if ($a_code instanceof ZError) {
                 return $this->showError($a_code->getCode(), $a_code->getMessage(), 0, 0, $a_code->getTrace());
             }
         }
     }
     $c = new ZDummyController($this, 'DummyController');
     $c->render(Zoombi::fromFrameworkDir('Views' . Zoombi::DS . 'view_error.php'), array('code' => $a_code, 'message' => $a_message, 'line' => $a_line, 'file' => $a_file, 'backtrace' => $a_backtrace));
     unset($c);
 }
 public function _exception_handler(Exception &$e)
 {
     $c = new ZDummyController($this);
     $c->render(Zoombi::fromFrameworkDir('Views' . Zoombi::DS . 'view_exception.php'), array('code' => $e->getCode(), 'message' => $e->getMessage(), 'backtrace' => $e->getTrace(), 'line' => $e->getLine(), 'file' => $e->getFile()));
     unset($c);
 }