Example #1
0
 public function render($partial, $data = [], $handle = true)
 {
     if ($handle === true) {
         foreach ($data as $varName => $value) {
             ${$varName} = $value;
         }
         unset($data);
     }
     $path = $this->getPartialPath($partial);
     $file = $this->app->viewsPath() . Hash::get($path, 'dir') . DIRECTORY_SEPARATOR . Hash::get($path, 'file');
     try {
         if (file_exists($file)) {
             require_once $file;
         } else {
             throw new RequireFileException('view', Hash::get($path, 'file'), $this->app->viewsPath() . Hash::get($path, 'dir'));
         }
     } catch (RequireFileException $e) {
         die($e);
     }
 }
Example #2
0
 public function get($item)
 {
     return Hash::get($this->items, $item);
 }