/** * Render this element using the mapped method from $tbActiveFormMethods */ public function render() { if (!empty(self::$tbActiveFormMethods[$this->type])) { $method = self::$tbActiveFormMethods[$this->type]; $model = $this->getParent()->getModel(); $attribute = $this->name; $htmlOptions = $this->prepareHtmlOptions($this->attributes); switch ($method) { case 'checkBoxListRow': case 'radioButtonListRow': case 'dropDownListRow': case 'radioButtonListInlineRow': case 'checkBoxListInlineRow': return $this->getActiveFormWidget()->{$method}($model, $attribute, $this->items, $htmlOptions); default: return $this->getActiveFormWidget()->{$method}($model, $attribute, $htmlOptions); } } else { if ($this->wrapBootstrapTags) { $error = $this->getParent()->showErrorSummary ? '' : $this->renderError(); $output = array('{label}' => $this->renderControlLabel(), '{input}' => "<div class=\"controls\">\n" . $this->renderInput() . $error . $this->renderHint() . '</div>', '{hint}' => '', '{error}' => ''); return "<div class=\"control-group\">\n" . strtr($this->layout, $output) . '</div>'; } } return parent::render(); }
public function render() { if ($this->type === 'checkbox') { $output = "<div class='checkbox'><label>" . $this->renderInput() . $this->getLabel() . $this->renderHint() . "</label></div>"; return $output; } return parent::render(); }