本文整理汇总了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);
}