Exemplo n.º 1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if (!isset($this->clientOptions['donetext'])) {
         $this->clientOptions['donetext'] = 'Select';
     }
 }
Exemplo n.º 2
0
 /**
  * Initialize the widget.
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, ['container' => 'switch']);
     if ($this->hasModel()) {
         if (!isset($this->inputOptions['name'])) {
             $this->inputOptions['name'] = Html::getInputName($this->model, $this->attribute);
         }
         if (!isset($this->inputOptions['id'])) {
             $this->inputOptions['id'] = Html::getInputId($this->model, $this->attribute);
         }
     } else {
         $this->inputOptions['name'] = $this->name;
     }
     $this->inputOptions['uncheck'] = isset($this->uncheck) ? $this->uncheck : is_null($this->uncheck) ? null : '0';
     $this->inputOptions['value'] = isset($this->value) ? $this->value : '1';
 }