Exemple #1
0
 /**
  * 获取视图所在文件夹
  * @return string
  */
 public static function getViewPath($type = 'base')
 {
     if ($type == 'base') {
         $appConfig = Config::get('app');
         if (empty($appConfig['theme'])) {
             $viewPath = APP_PATH . '/views';
         } else {
             $viewPath = APP_PATH . '/views/' . $appConfig['theme'];
         }
     } elseif ($type == 'module') {
         $module = RouteHandle::getModuleName();
         $viewPath = APP_PATH . '/Modules/' . $module . '/views/';
     }
     //进行view地址进行校验,不存在则生成,防止plates报错
     if (!file_exists($viewPath)) {
         Filesystem::mkdir($viewPath);
     }
     return $viewPath;
 }