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


PHP Config::getLang方法代碼示例

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


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

示例1: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!isset($this->language)) {
         $this->language = Yii::$app->language;
     }
     $this->_lang = Config::getLang($this->language);
     if ($this->pluginLoading) {
         $this->_loadIndicator = self::LOAD_PROGRESS;
     }
     if ($this->hasModel()) {
         $this->name = empty($this->options['name']) ? Html::getInputName($this->model, $this->attribute) : $this->options['name'];
         $this->value = Html::getAttributeValue($this->model, $this->attribute);
     }
     $this->initDisability($this->options);
     $view = $this->getView();
     WidgetAsset::register($view);
 }
開發者ID:ceif,項目名稱:Autarquia-Livre,代碼行數:21,代碼來源:InputWidget.php

示例2: initInputWidget

 /**
  * Initializes the input widget
  */
 protected function initInputWidget()
 {
     $this->initI18N(__DIR__, 'kvbase');
     if (!isset($this->language)) {
         $this->language = Yii::$app->language;
     }
     $this->_lang = Config::getLang($this->language);
     if ($this->pluginLoading) {
         $this->_loadIndicator = self::LOAD_PROGRESS;
     }
     if ($this->hasModel()) {
         $this->name = empty($this->options['name']) ? Html::getInputName($this->model, $this->attribute) : $this->options['name'];
         $this->value = Html::getAttributeValue($this->model, $this->attribute);
     }
     $this->initDisability($this->options);
 }
開發者ID:DiegoRodriguezTandil,項目名稱:MoisesVille,代碼行數:19,代碼來源:InputWidget.php

示例3: getLocaleFile

 /**
  * Fetches the locale settings file.
  *
  * @param string $lang the locale/language ISO code.
  *
  * @return string the locale file name.
  */
 protected static function getLocaleFile($lang)
 {
     $s = DIRECTORY_SEPARATOR;
     $file = __DIR__ . "{$s}locales{$s}{$lang}{$s}dateSettings.php";
     if (!file_exists($file)) {
         $langShort = Config::getLang($lang);
         $file = __DIR__ . "{$s}locales{$s}{$langShort}{$s}dateSettings.php";
     }
     return $file;
 }
開發者ID:kartik-v,項目名稱:yii2-datecontrol,代碼行數:17,代碼來源:DateControl.php

示例4: setLocale

 /**
  * Sets the locale using the locales configuration settings
  */
 protected function setLocale()
 {
     if (!$this->_doTranslate || !empty($this->pluginOptions['dateSettings'])) {
         return;
     }
     $s = DIRECTORY_SEPARATOR;
     $file = __DIR__ . "{$s}locales{$s}{$this->language}{$s}dateSettings.php";
     if (!file_exists($file)) {
         $langShort = Config::getLang($this->language);
         $file = __DIR__ . "{$s}locales{$s}$langShort{$s}dateSettings.php";
     }
     if (file_exists($file)) {
         $this->pluginOptions['dateSettings'] = require_once($file);
     }
 }
開發者ID:jplagahit,項目名稱:brdsdev,代碼行數:18,代碼來源:DateControl.php

示例5: initInputWidget

 /**
  * {@inheritDoc} Extends the parent to leave out code duplicated in getInput whereby name and value get set again.
  */
 protected function initInputWidget()
 {
     $this->initI18N(__DIR__, 'kvbase');
     if (!isset($this->language)) {
         $this->language = Yii::$app->language;
     }
     $this->_lang = Config::getLang($this->language);
     if ($this->pluginLoading) {
         $this->_loadIndicator = self::LOAD_PROGRESS;
     }
     $this->initDisability($this->options);
 }
開發者ID:andrewblake1,項目名稱:yii2-credit-card,代碼行數:15,代碼來源:InputWidget.php


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