/** * Load file language * * @param string * @return void */ static function load($name) { $lang = Config::read('App.Base.language'); $prop = Loader::getName($name, 'locale' . DS . $lang); // if file already loaded? if so done! if (isset(self::$language[$prop->app])) { return self::$language[$prop->app]; } // is file not exists? if (!file_exists($prop->path)) { user_error('Language Not Found ' . $prop->path); exit; } self::$language[$prop->app] = (require_once $prop->path); }
/** * load file config * * @param string * @return array */ static function load($name) { if ($name == '') { return self::$data; } $name = Loader::getName($name, 'config'); $key = $name->app . '.' . $name->class; if (!isset(static::$data[$key])) { // file config is exist? if (!file_exists($name->path)) { user_error('Config ' . $name->path . ' Not Found'); exit; } self::$data[$key] = (require_once $name->path); } return self::$data[$key]; }
/** * Load View File * * @param string * @param array * @param boolean * @return void|html; */ public static function load($_sky_name, $_sky_var = [], $_sky_return = false) { $__prop = Loader::getName($_sky_name, 'view'); if (!file_exists($__prop->path)) { Exceptions::showError('Server Error', 'Missing View File: ' . $__prop->path); return; } // extract array to variable extract($_sky_var); ob_start(); include $__prop->path; $__view = ob_get_contents(); ob_end_clean(); if ($_sky_return) { return $__view; } self::$temp .= $__view; }