Beispiel #1
0
 /**
  * Executes the widget.
  */
 public function run()
 {
     echo Html::tag('div', '', $this->containerOptions);
     if ($this->hasModel()) {
         echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
         $this->clientOptions['value'] = $this->model[$this->attribute];
     } else {
         echo Html::hiddenInput($this->name, $this->value, $this->options);
         $this->clientOptions['value'] = $this->value;
     }
     if (!isset($this->clientEvents['slide'])) {
         $this->clientEvents['slide'] = 'function (event, ui) {
             $("#' . $this->options['id'] . '").val(ui.value);
         }';
     }
     $this->registerWidget('slider', SliderAsset::className(), $this->containerOptions['id']);
 }
Beispiel #2
0
 /**
  * Executes the widget.
  */
 public function run()
 {
     echo Html::tag('div', '', $this->options);
     $this->registerWidget('slider', SliderAsset::className());
 }