/**
  * Registers the needed assets
  */
 public function registerAssets()
 {
     $view = $this->getView();
     $path = Yii::getAlias("@vendor/kartik-v/strength-meter");
     $this->setLanguage('strength-meter-', $path, 'js/locales');
     if (!empty($this->_langFile)) {
         PasswordInputAsset::register($view)->js[] = $this->_langFile;
     } else {
         PasswordInputAsset::register($view);
     }
     $this->registerPlugin($this->pluginName);
 }
Beispiel #2
0
 /**
  * Registers the needed assets
  */
 public function registerAssets()
 {
     $view = $this->getView();
     $locale = "js/locales/strength-meter-{$this->language}.js";
     $path = Yii::getAlias("@vendor/kartik-v/strength-meter/{$locale}");
     if (!empty($this->language) && file_exists($path)) {
         PasswordInputAsset::register($view)->js[] = $locale;
     } else {
         PasswordInputAsset::register($view);
     }
     $this->registerPlugin('strength');
 }