Example #1
0
 public function printTrace()
 {
     $header = Html::tag('div', $this->exception . ' at ' . Hash::get($_SERVER, 'REQUEST_URI'), ['class' => 'head message']);
     $message = Html::tag('h2', "Record not found.", ['class' => 'message']);
     $debug = Html::tag('div', $this->fullCallerString, ['class' => 'debug']);
     echo Html::tag('div', $header . $message . $debug, ['class' => 'exception']);
 }
Example #2
0
 public function printTrace()
 {
     $header = Html::tag('div', $this->exception . ' at ' . Hash::get($_SERVER, 'REQUEST_URI'), ['class' => 'head message']);
     $message = Html::tag('h2', "'{$this->calledWithArgs}' not a valid argument for '{$this->methodWhoCall}'", ['class' => 'message']);
     $debug = Html::tag('div', $this->fullCallerString, ['class' => 'debug']);
     echo Html::tag('div', $header . $message . $debug, ['class' => 'exception']);
 }
Example #3
0
 public function __construct($code = 0, Exception $previous = null)
 {
     parent::__construct($code, $previous);
     $callers = Hash::get($this->getTrace(), 0);
     $caller = Hash::get($this->getTrace(), 1);
     $this->fullCallerString = Hash::get($caller, 'class') . Hash::get($caller, 'type') . Hash::get($caller, 'function') . '() with arguments: \'' . implode(', ', Hash::get($caller, 'args')) . '\' at line: ' . Hash::get($caller, 'line');
     $this->controllerCallLine = Hash::get($callers, 'line');
     $this->methodWhoCall = Hash::get($callers, 'function');
     $this->calledFromClass = Hash::get($callers, 'class');
     $this->calledWithArgs = Hash::get($callers, 'args')[0];
 }
Example #4
0
 private function getPartialPath($partial)
 {
     $path = [];
     $partial = ltrim($partial, '/') . '.html.php';
     if (!strpos($partial, '/')) {
         Hash::set($path, 'file', $partial);
     } else {
         $tmp = explode('/', $partial);
         Hash::set($path, 'file', array_pop($tmp));
         Hash::set($path, 'dir', join($tmp));
     }
     return $path;
 }
Example #5
0
 public function __isset($key)
 {
     return Hash::keyExists($this->columns, $key);
 }
Example #6
0
 /**
  * @param $key
  * @param $value
  */
 public function __set($key, $value)
 {
     Hash::set($this->params, $key, $value);
 }
Example #7
0
 /**
  * Controller handler by request params.
  *
  * @param array $url Request string (URI)
  * @return void
  */
 private function initializeController($url)
 {
     if (is_readable(Env::path() . implode('/', $url))) {
         exit;
     }
     $this->controller = $this->routes->getControllerName();
     try {
         $this->createInstance(Env::path('controller') . $this->controller . '.php');
     } catch (Exception $e) {
         echo 'wrong controller';
     }
     $this->action = empty($url[0]) ? Hash::get($this->route, 'action') : Hash::extract($url);
     $this->initializeAction($url);
 }
Example #8
0
 public function keyExists($key)
 {
     return Hash::keyExists($this->yaml, $key);
 }