Esempio n. 1
0
 public function render($name, $_DATA_ = false, $_PREFIX_ = false)
 {
     if ($name[0] == '~') {
         $name = substr($name, 1);
         $_PATH_ = DIR_SHARED . "/View/{$name}.html";
     } else {
         $_PATH_ = DIR_VIEWS . "/{$name}.html";
     }
     if (!is_readable_file($_PATH_)) {
         new \Exception("Could not read file '{$_PATH_}'");
     }
     if (is_array($_DATA_)) {
         extract($_DATA_);
     }
     ob_start();
     include $_PATH_;
     return is_string($_PREFIX_) ? View::prefix(ob_get_clean(), $_PREFIX_) : ob_get_clean();
 }