Example #1
0
 /**
  *  Render a view. This method instead of Load::view() prefixes paths with current module directory.
  */
 public static function render($views, $data = [])
 {
     $views = (array) $views;
     foreach ($views as $key => $item) {
         $views[$key] = Router::$module . DS . 'Views' . DS . $item;
     }
     Load::view($views, $data);
 }
Example #2
0
 /**
  * Example method for help page.
  *
  * @access public
  * @static
  * @return void
  */
 public static function help()
 {
     Load::view('Defaults/Views/help.html');
 }
Example #3
0
 /**
  * Output an error to the browser and stop script execution.
  *
  * @access public
  * @static
  * @param  int    $error_code
  * @param  string $error_string (default: '')
  * @param  string $description  (default: '')
  * @return void
  */
 public static function error($error_code, $error_string = '', $description = '')
 {
     header('HTTP/1.0 ' . $error_code . ' ' . $error_string);
     $data = ['description' => $description];
     Load::view("Errors/E{$error_code}.html", $data);
     exit;
 }