_htmlBeforeElement; } public function setHtmlBeforeElement($htmlBeforeElement) { $this->_htmlBeforeElement = $htmlBeforeElement; return $this; } public function getHtmlAfterElement() { return $this->_htmlAfterElement; } public function setHtmlAfterElement($htmlAfterElement) { $this->_htmlAfterElement = $htmlAfterElement; return $this; } protected function _initAppendPrepend() { /** @var \Zend_Form_Element $element */ $element = $this->getElement(); $classes = []; $before = ''; $after = ''; foreach (['prepend', 'prependHtml', 'append', 'appendHtml'] as $attribute) { if (!($text = $element->getAttrib($attribute))) { continue; } $classes[] = 'input-' . str_replace('Html', '', $attribute); $element->setAttrib($attribute, null); switch ($attribute) { case 'prepend': $before .= '' . $text . ''; break; case 'append': $after .= '' . $text . ''; break; case 'prependHtml': $before .= $text; break; case 'appendHtml': $after .= $text; break; } } $classes = array_unique($classes); if (!$classes) { return $this; } $htmlTag = $element->getDecorator('HtmlTag'); if ($htmlTag->getOption('tag') == 'div') { $htmlTag->setOption('class', Html::addClass($htmlTag->getOption('class'), implode(' ', $classes))); } else { $before = '
' . $before; $after .= '
'; } if ($before) { $this->setHtmlBeforeElement($this->getHtmlBeforeElement() . $before); } if ($after) { $this->setHtmlAfterElement($this->getHtmlAfterElement() . $after); } return $this; } }