예제 #1
0
파일: load.php 프로젝트: robertabramski/pep
 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));
     }
 }
예제 #2
0
파일: view.php 프로젝트: robertabramski/pep
 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));
     }
 }
예제 #3
0
function show_error($message = '', $title = 'Error')
{
    Pep::show_error($message, $title);
}