Class yii\jui\DatePickerLanguageAsset
Inheritance | yii\jui\DatePickerLanguageAsset » yii\web\AssetBundle |
---|---|
Available since extension's version | 2.0 |
Source Code | https://github.com/yiisoft/yii2-jui/blob/master/DatePickerLanguageAsset.php |
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$autoGenerate | boolean | Whether to automatically generate the needed language js files. | yii\jui\DatePickerLanguageAsset |
$depends | yii\jui\DatePickerLanguageAsset | ||
$language | string | Language to register translation file for | yii\jui\DatePickerLanguageAsset |
$sourcePath | yii\jui\DatePickerLanguageAsset |
Public Methods
Method | Description | Defined By |
---|---|---|
registerAssetFiles() | yii\jui\DatePickerLanguageAsset |
Property Details
Whether to automatically generate the needed language js files. If this is true, the language js files will be determined based on the actual usage of yii\jui\DatePicker and its language settings. If this is false, you should explicitly specify the language js files via js.
Method Details
public void registerAssetFiles ( $view ) | ||
$view |
public function registerAssetFiles($view)
{
if ($this->autoGenerate) {
$language = $this->language;
$fallbackLanguage = substr($this->language, 0, 2);
if ($fallbackLanguage !== $this->language && !file_exists(Yii::getAlias($this->sourcePath . "/ui/i18n/datepicker-{$language}.js"))) {
$language = $fallbackLanguage;
}
$this->js[] = "ui/i18n/datepicker-$language.js";
}
parent::registerAssetFiles($view);
}