當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::fileExists方法代碼示例

本文整理匯總了PHP中kartik\base\Config::fileExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::fileExists方法的具體用法?PHP Config::fileExists怎麽用?PHP Config::fileExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kartik\base\Config的用法示例。


在下文中一共展示了Config::fileExists方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: registerAssetBundle

  /**
  * Registers the asset bundle and locale
  */
 protected function registerAssetBundle() {
     $view = $this->getView();
     if (!empty($this->language) && substr($this->language, 0, 2) != 'en') {
         $path = __DIR__ . '/lib';
         $file = "select2_locale_{$this->language}.js";
         if (!Config::fileExists("{$path}/{$file}")) {
             $file = "select2_locale_{$this->_lang}.js";
         }
         if (Config::fileExists("{$path}/{$file}")) {
             Select2Asset::register($view)->js[] = $file;
             return;
         }
     }
     Select2Asset::register($view);
 }
開發者ID:jplagahit,項目名稱:brdsdev,代碼行數:18,代碼來源:Select2.php

示例2: setLanguage

 /**
  * Sets the language JS file if it exists
  *
  * @param string $assetPath the path to the assets
  * @param string $filePath the path to the JS file with the file name prefix
  * @param string $suffix the file name suffix - defaults to '.js'
  */
 protected function setLanguage($prefix, $assetPath = null, $filePath = null, $suffix = '.js')
 {
     $pwd = Config::getCurrentDir($this);
     $s = DIRECTORY_SEPARATOR;
     if ($assetPath === null) {
         $assetPath = "{$pwd}{$s}assets{$s}";
     } elseif (substr($assetPath, -1) != $s) {
         $assetPath .= $s;
     }
     if ($filePath === null) {
         $filePath = "js{$s}locales{$s}";
     } elseif (substr($filePath, -1) != $s) {
         $filePath .= $s;
     }
     $full = $filePath . $prefix . $this->language . $suffix;
     $fullLower = $filePath . $prefix . strtolower($this->language) . $suffix;
     $short = $filePath . $prefix . $this->_lang . $suffix;
     if (Config::fileExists($assetPath . $full)) {
         $this->_langFile = $full;
         $this->pluginOptions['language'] = $this->language;
     } elseif (Config::fileExists($assetPath . $fullLower)) {
         $this->_langFile = $fullLower;
         $this->pluginOptions['language'] = strtolower($this->language);
     } elseif (Config::fileExists($assetPath . $short)) {
         $this->_langFile = $short;
         $this->pluginOptions['language'] = $this->_lang;
     } else {
         $this->_langFile = '';
     }
     $this->_langFile = str_replace($s, '/', $this->_langFile);
 }
開發者ID:ceif,項目名稱:Autarquia-Livre,代碼行數:38,代碼來源:InputWidget.php

示例3: registerAssetBundle

 /**
  * Registers the asset bundle and locale
  */
 protected function registerAssetBundle()
 {
     $view = $this->getView();
     if (!empty($this->language) && substr($this->language, 0, 2) != 'en') {
         $path = Yii::getAlias('@vendor/kartik-v/bootstrap-fileinput/js');
         $file = "fileinput_locale_{$this->language}.js";
         if (!Config::fileExists("{$path}/{$file}")) {
             $file = "fileinput_locale_{$this->_lang}.js";
         }
         if (Config::fileExists("{$path}/{$file}")) {
             FileInputAsset::register($view)->js[] = 'js/' . $file;
             return;
         }
     }
     FileInputAsset::register($view);
 }
開發者ID:keltstr,項目名稱:basic,代碼行數:19,代碼來源:FileInput.php


注:本文中的kartik\base\Config::fileExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。