/** * Initializes the widget. * This renders the form open tag. */ public function init() { if (!isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = 'form-' . $this->type; } else { $this->htmlOptions['class'] .= ' form-' . $this->type; } if (!isset($this->inlineErrors)) { $this->inlineErrors = $this->type === self::TYPE_HORIZONTAL; } if (!isset($this->errorField)) { self::$showError = $this->errorField; } if ($this->inlineErrors) { $this->errorMessageCssClass = 'help-inline error'; } else { $this->errorMessageCssClass = 'help-block has-error'; } if ($this->enter2tab) { $this->enterToTab(); } $this->htmlOptions['role'] = "form"; parent::init(); }