/** * Create element of container that contains caption texts or tags * @param FormElement $formElement * @return HtmlElement */ protected function _createCaptionContainer(FormElement $formElement) { // create container element $containerElement = new HtmlElement($this->_captionContainerTagName); if ($this->_captionContainerClass) { $containerElement->addClass($this->_captionContainerClass); } $formElement->setCaptionContainer($containerElement); // set caption if ($formElement->getCaption() != null) { $caption = sprintf($this->_captionFormat, $formElement->getCaption()); $containerElement->setText($caption); } return $containerElement; }