示例#1
0
文件: default.php 项目: hiloy/autophp
 private static function _getSlotPath($name)
 {
     if (strpos($name, '/') !== false) {
         $seps = explode('/', $name);
         foreach ($seps as $k => $v) {
             $seps[$k] = util::parseFilename($v);
         }
         $name = implode('/', $seps);
     } else {
         $name = util::parseFilename($name);
     }
     $file = APP_PATH . DS . 'view' . DS . 'slot' . DS . $name . '.php';
     if (!file_exists($file)) {
         throw new exception_render('slot not exist: ' . $name, exception_render::type_slot_not_exist);
     }
     return $file;
 }
示例#2
0
 private static function _getDataByFilename($alias)
 {
     $alias = util::parseFilename($alias);
     $fileName = $alias . '.php';
     $file = APP_PATH . DS . 'config' . DS . $fileName;
     $tmp = util::loadFile($file);
     if ($tmp === null && self::$_confPaths) {
         foreach (self::$_confPaths as $path) {
             $file = $path . DS . $fileName;
             $tmp = util::loadFile($file);
             if ($tmp !== null) {
                 break;
             }
         }
     }
     return $tmp;
 }
示例#3
0
文件: i18n.php 项目: hiloy/autophp
 protected static function _getDataByFilename($alias)
 {
     $alias = util::parseFilename($alias);
     $fileName = $alias . '.php';
     $file = APP_PATH . DS . 'i18n' . DS . $fileName;
     $tmp = util::loadFile($file);
     if ($tmp === null && self::$_confPaths) {
         foreach (self::$_confPaths as $path) {
             $file = $path . DS . $fileName;
             $tmp = util::loadFile($file);
             if ($tmp !== null) {
                 break;
             }
         }
     }
     if ($tmp === null) {
         throw new exception_i18n('language do not exist of:' . $alias, exception_i18n::type_language_not_exist);
     }
     return $tmp;
 }