/** * @param HtmlElement|string $helpText * * @return $this|self */ public function setHelpText($helpText) : self { if (!$helpText instanceof HtmlElement) { $helpText = new HtmlElement('<span>', $helpText); } $helpText->addClass('help-block'); // @see http://getbootstrap.com/css/#forms-help-text if ($this->getField()) { if (!$helpText->getId()) { $helpText->generateId(); } $this->getField()->addAttribute('aria-describedby', $helpText->getId()); } $this->helpText = $helpText; return $this; }