Class yii\jui\DatePickerLanguageAsset

Inheritanceyii\jui\DatePickerLanguageAsset » yii\web\AssetBundle
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-jui/blob/master/DatePickerLanguageAsset.php

Public Properties

Hide inherited 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

Hide inherited methods

Method Description Defined By
registerAssetFiles() yii\jui\DatePickerLanguageAsset

Property Details

Hide inherited properties

$autoGenerate public property

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.

public boolean $autoGenerate true
$depends public property
public $depends = [
    
'yii\jui\JuiAsset',
]
$language public property

Language to register translation file for

public string $language null
$sourcePath public property
public $sourcePath '@bower/jquery-ui'

Method Details

Hide inherited methods

registerAssetFiles() public method

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);
}