init() public method

If you override this method, make sure you call the parent implementation in the last.
public init ( )
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->setSourcePath('@vendor/branchonline/yii2-select2/assets/select2');
     $this->setupAssets('css', ['select2']);
     $this->setupAssets('js', ['select2.min']);
     parent::init();
 }
Example #2
0
 public function init()
 {
     parent::init();
     //$this->js[] = 'script.js';
     $this->css[] = 'css/pane.css';
     $this->css[] = 'css/checkout.css';
 }
 /**
  * Initializes the bundle.
  * Set publish options to copy only necessary files (in this case css and font folders)
  * @codeCoverageIgnore
  */
 public function init()
 {
     parent::init();
     $this->publishOptions['beforeCopy'] = function ($from, $to) {
         return preg_match('%(/|\\\\)(fonts|css)%', $from);
     };
 }
 public function init()
 {
     parent::init();
     $this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'source';
     $this->depends[] = JqueryAsset::className();
     $this->depends[] = BootstrapThemeAsset::className();
 }
 public function init()
 {
     $this->css[] = YII_DEBUG ? 'vendor/css/bootstrap-datetimepicker.css' : 'vendor/css/bootstrap-datetimepicker.min.css';
     $this->js[] = YII_DEBUG ? 'vendor/js/bootstrap-datetimepicker.js' : 'vendor/js/bootstrap-datetimepicker.min.js';
     $this->js[] = 'bootstrap-editable-datetimepicker.js';
     parent::init();
 }
Example #6
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $postfix = YII_DEBUG ? '' : '.min';
     $this->css[] = 'summernote.css';
     $this->js[] = 'summernote' . $postfix . '.js';
     parent::init();
 }
 public function init()
 {
     parent::init();
     $this->sourcePath = __DIR__ . '/assets';
     $this->setupAssets('css', ['css/blockmodels']);
     $this->setupAssets('js', ['js/blockmodels']);
 }
Example #8
0
 public function init()
 {
     parent::init();
     if ($this->sourcePath == null) {
         $this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR . 'assets';
     }
 }
Example #9
0
 public function init()
 {
     $this->js[] = 'ckeditor.js';
     //?v=' . microtime();
     $this->js[] = 'ckeditor.sample.init.js?v=' . microtime();
     parent::init();
 }
 public function init()
 {
     parent::init();
     $this->publishOptions['beforeCopy'] = function ($from, $to) {
         return strpos($from, 'fonts') !== false || strpos($from, 'css') !== false;
     };
 }
Example #11
0
 public function init()
 {
     parent::init();
     if (!file_exists(\Yii::getAlias('@bower/sticky/jquery.sticky.js'))) {
         throw new InvalidConfigException('You must include `bower-asset/sticky` package in your composer.json configuration file.');
     }
 }
 public function init()
 {
     $this->setSourcePath('@rnd/lib/multidatespicker');
     $this->setupAssets('css', ['mdp', 'jquery-ui']);
     $this->setupAssets('js', ['jquery-ui.multidatespicker', 'ui.datepicker-th']);
     parent::init();
 }
Example #13
0
 public function init()
 {
     $this->sourcePath = __DIR__ . "/assets";
     $this->css = [YII_DEBUG ? 'css/upload-kit.css' : 'css/upload-kit.min.css'];
     $this->js = [YII_DEBUG ? 'js/upload-kit.js' : 'js/upload-kit.min.js'];
     parent::init();
 }
Example #14
0
 public function init()
 {
     parent::init();
     if (!file_exists(\Yii::getAlias('@bower/history.js/scripts/bundled/html5/native.history.js'))) {
         throw new InvalidConfigException('You must include `bower-asset/history.js` package in your composer.json configuration file.');
     }
 }
 public function init()
 {
     $this->basePath = __DIR__ . '/assets';
     list(, $url) = Yii::$app->assetManager->publish(__DIR__ . '/assets');
     $this->baseUrl = $url;
     parent::init();
 }
Example #16
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $postfix = YII_DEBUG ? '' : '.min';
     $this->js[] = 'jstree' . $postfix . '.js';
     $this->css[] = 'themes/default/style' . $postfix . '.css';
     parent::init();
 }
Example #17
0
 public function init()
 {
     if ($this->skin) {
         $this->css[] = "css/plugin/iCheck/square/{$this->skin}.css";
     }
     parent::init();
 }
Example #18
0
 public function init()
 {
     if (!empty($this->js) && $this->enableLocale && ($language = $this->getLanguage()) !== null) {
         $this->js[] = 'js/locales/bootstrap-datepicker.' . $language . '.min.js';
     }
     parent::init();
 }
Example #19
0
 public function init()
 {
     $this->setSourcePath(__DIR__ . '/assets');
     $this->setupAssets('css', ['css/zTreeStyle']);
     $this->setupAssets('js', ['js/jquery.ztree.all-3.5']);
     parent::init();
 }
 public function init()
 {
     // pr(Yii::$app->view->theme->selectedTheme);die;
     // $this->js = $this->_populateFiles('js');
     // $this->css = $this->_populateFiles('css');
     parent::init();
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (static::$skin) {
         $this->css[] = sprintf('css/skins/%s.min.css', static::$skin);
     }
 }
 /**
  * Initialize the widget.
  * 
  * If YII_ENV_DEV is defined, the not minified version of the css and the js files
  * are used.
  * @see \yii\web\AssetBundle::init()
  */
 public function init()
 {
     $this->sourcePath = __DIR__ . '/assets';
     $this->js = ['js/pnotify.custom' . (YII_ENV_DEV ? '.js' : '.min.js')];
     $this->css = ['css/pnotify.custom' . (YII_ENV_DEV ? '.css' : '.min.css')];
     return parent::init();
 }
Example #23
0
 public function init()
 {
     if (YII_ENV == 'dev') {
         $this->publishOptions = ['forceCopy' => true];
     }
     parent::init();
 }
Example #24
0
 /**
  * Adds timeago locale depending on app language if {locale} is true.
  * If the app language is set to English this step is skipped.
  */
 public function init()
 {
     /**
      * If strings are set in plugin settings, disable locale loading.
      */
     if (isset($this->settings['strings'])) {
         $this->locale = false;
         $this->short = false;
     }
     /**
      * Add locale js to stack.
      */
     if ($this->locale || $this->short) {
         /**
          * Sanitize language.
          */
         $language = str_replace('_', '-', strtolower(Yii::$app->language));
         if (($this->short || strpos($language, 'en') !== 0) && !$this->setLocaleScript($language)) {
             /**
              * Try short version.
              */
             if ($language = substr($language, 0, strpos($language, '-'))) {
                 $this->setLocaleScript($language);
             }
         }
     }
     parent::init();
 }
 public function init()
 {
     parent::init();
     if (YII_DEBUG) {
         $this->js[] = 'intercooler-debugger.js';
     }
 }
Example #26
0
 public function init()
 {
     $this->sourcePath = __DIR__ . '/assets';
     $this->css = ['css/bootstrap-switch.min.css'];
     $this->js = ['js/bootstrap-switch.min.js'];
     parent::init();
 }
Example #27
0
 public function init()
 {
     if (empty($this->js)) {
         $this->js = $this->getJs();
     }
     return parent::init();
 }
Example #28
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->registerOnlyRouteScript) {
         $this->js = ['js/rbac-route.js'];
     }
     parent::init();
 }
 public function init()
 {
     parent::init();
     if ($this->locale === null) {
         $this->locale = \Yii::$app->language;
     }
 }
 public function init()
 {
     $this->sourcePath = __DIR__ . '/assets';
     $this->js = ['moment.min.js', 'daterangepicker.js'];
     $this->css = ['daterangepicker-bs3.css'];
     parent::init();
 }