本文整理匯總了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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}