public function helper($name) { $file = APP_DIR . 'helpers/' . strtolower($name) . '.php'; if (file_exists($file)) { require_once $file; $helper = new $name(); return $helper; } else { Pep::show_error(sprintf('The helper file %s.php failed to load.', $name)); } }
private function render_view($data = null) { $language = Pep::get_setting('language'); if (!empty($language)) { $file = APP_DIR . 'languages/' . strtolower($language) . '.php'; if (file_exists($file)) { include $file; } else { Pep::show_error(sprintf('The language file %s.php does not exist.', $language)); } } if ($data) { extract($data); } if (file_exists($this->template)) { $minified = Pep::get_setting('minify'); $minified ? ob_start(array($this, 'minify')) : ob_start(); require $this->template; ob_end_flush(); } else { // No view exists at all. Pep::show_error(sprintf('The view file %s.php does not exist.', $this->view)); } }
function show_error($message = '', $title = 'Error') { Pep::show_error($message, $title); }