registerAsset(); $this->registerJs(); return $this->renderCheckBox(); } /** * 初始化 */ public function init() { parent::init(); if ($this->hasModel() && !isset($options['name'])) { $this->name = $this->options['name'] = Html::getInputName($this->model, $this->attribute); } } /** * 注册js和css */ protected function registerAsset() { $view = $this->getView(); IcheckAsset::register($view); } /** * 注册js */ protected function registerJs() { $js = <<