Example #1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     $this->setPluginOptions();
     $this->registerAssets();
     echo $this->getInput('textInput');
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     $this->pluginName = $this->pluginConflict ? 'bootstrapSlider' : 'slider';
     if (!empty($this->value) || $this->value === 0) {
         if (is_array($this->value)) {
             throw new InvalidConfigException("Value cannot be passed as an array. If you wish to setup a range slider, pass the two values together as strings separated with a ',' sign.");
         }
         if (strpos($this->value, ',') > 0) {
             $values = explode(',', $this->value);
             static::validateValue($values[0]);
             static::validateValue($values[1]);
             $this->pluginOptions['value'] = [(double) $values[0], (double) $values[1]];
             $this->pluginOptions['range'] = true;
         } else {
             static::validateValue($this->value);
             $this->pluginOptions['value'] = (double) $this->value;
         }
     } else {
         // initialize value
         $this->pluginOptions['value'] = null;
     }
     Html::addCssClass($this->options, 'form-control');
     // initialize if disabled
     $this->_isDisabled = !empty($this->options['disabled']) && $this->options['disabled'] || !empty($this->options['readonly']) && $this->options['readonly'] || isset($this->disabled) && $this->disabled || isset($this->readonly) && $this->readonly;
     if ($this->_isDisabled) {
         $this->pluginOptions['enabled'] = false;
     }
     $this->registerAssets();
     echo $this->getInput('textInput');
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     $this->initLanguage();
     if ($this->hasModel()) {
         $this->name = ArrayHelper::remove($this->options, 'name', Html::getInputName($this->model, $this->attribute));
         $this->value = $this->model[$this->attribute];
     }
     echo $this->getInput('passwordInput');
     if (empty($this->pluginOptions['inputTemplate']) && ($this->size === 'lg' || $this->size === 'sm' || $this->togglePlacement === 'left')) {
         $this->pluginOptions['inputTemplate'] = $this->renderInputTemplate();
     }
     $this->registerAssets();
     parent::run();
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     $this->renderWidget();
 }
Example #5
0
 /**
  * Runs widget
  *
  * @return string|void
  */
 public function run()
 {
     $this->registerAssets();
     echo $this->getDisplayInput() . $this->getSaveInput();
     parent::run();
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     $this->renderDatePicker();
 }
Example #7
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     if (empty($this->type) && $this->type !== self::CHECKBOX && $this->type !== self::RADIO) {
         throw new InvalidConfigException("You must define a valid 'type' which must be either 1 (for checkbox) or 2 (for radio).");
     }
     if ($this->type == self::RADIO) {
         if (empty($this->items) || !is_array($this->items)) {
             throw new InvalidConfigException("You must setup the 'items' array for the 'radio' type.");
         }
     }
     $this->registerAssets();
     echo $this->renderInput();
 }