for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/codenix-sv/yii2-flatpickr
* @copyright Copyright (c) 2017 codenix-sv
* @license https://github.com/codenix-sv/yii2-flatpickr/blob/master/LICENSE
*/
namespace codenixsv\flatpickr\assets;
use yii\web\AssetBundle;
* Class FlatpickrAsset
* @package codenixsv\flatpickr\assets
class FlatpickrAsset extends AssetBundle
{
/** @var string */
public $sourcePath = '@npm/flatpickr/dist';
/** @var array */
public $js = [
'flatpickr.min.js',
];
public $css = [
'flatpickr.min.css',
public $theme;
public $locale;
* @inheritdoc
public function registerAssetFiles($view)
$this->registerLanguageFile();
$this->registerThemeFile();
parent::registerAssetFiles($view);
}
* Registers language file
private function registerLanguageFile()
if (!empty($this->locale) && ($this->locale !== 'en')) {
$this->js[] = 'l10n/' . $this->locale . '.js';
* Registers theme
private function registerThemeFile()
if (!empty($this->theme)) {
$this->css[] = 'themes/' . $this->theme . '.css';