original_string: protected function renderSwitch()
      {
          $value = ArrayHelper::getValue($this->inputOptions, 'value', null);
  
          if ($this->hasModel()) {
              $attributeValue = Html::getAttributeValue($this->model, $this->attribute);
              $this->checked = "{$value}" === "{$attributeValue}";
          }
  
          $name = ArrayHelper::remove($this->inputOptions, 'name', null);
  
          return implode("\n", [
              Html::beginTag('label'),
              $this->renderLabel('off'),
              Html::checkbox($name, $this->checked, $this->inputOptions),
              Html::tag('span', '', ['class' => 'lever']),
              $this->renderLabel('on'),
              Html::endTag('label'),
          ]);
      }
code: protected function renderSwitch()
      {
          $value = ArrayHelper::getValue($this->inputOptions, 'value', null);
  
          if ($this->hasModel()) {
              $attributeValue = Html::getAttributeValue($this->model, $this->attribute);
              $this->checked = "{$value}" === "{$attributeValue}";
          }
  
          $name = ArrayHelper::remove($this->inputOptions, 'name', null);
  
          return implode("\n", [
              Html::beginTag('label'),
              $this->renderLabel('off'),
              Html::checkbox($name, $this->checked, $this->inputOptions),
              Html::tag('span', '', ['class' => 'lever']),
              $this->renderLabel('on'),
              Html::endTag('label'),
          ]);
      }
code_tokens: protected function renderSwitch ( ) { $ value = ArrayHelper :: getValue ( $ this -> inputOptions , 'value' , null ) ; if ( $ this -> hasModel ( ) ) { $ attributeValue = Html :: getAttributeValue ( $ this -> model , $ this -> attribute ) ; $ this -> checked = "{$value}" === "{$attributeValue}" ; } $ name = ArrayHelper :: remove ( $ this -> inputOptions , 'name' , null ) ; return implode ( "\n" , [ Html :: beginTag ( 'label' ) , $ this -> renderLabel ( 'off' ) , Html :: checkbox ( $ name , $ this -> checked , $ this -> inputOptions ) , Html :: tag ( 'span' , '' , [ 'class' => 'lever' ] ) , $ this -> renderLabel ( 'on' ) , Html :: endTag ( 'label' ) , ] ) ; }
docstring: Render the switch button checkbox.
  @return string
  @uses [yii\helper\BaseHtml::checkbox()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#checkbox()-detail)
docstring_tokens: Render the switch button checkbox .