Wrap form notifications in <p> by default, not <div>

This commit is contained in:
Johannes Meyer 2014-10-13 09:41:36 +02:00
parent 13678bb33e
commit b5798331db
2 changed files with 18 additions and 3 deletions

View File

@ -88,7 +88,15 @@ EOT;
$this->addElement(
new Note(
'suggestion',
array('value' => $html)
array(
'value' => $html,
'decorators' => array(
'ViewHelper',
array(
'HtmlTag', array('tag' => 'div')
)
)
)
)
);

View File

@ -5,7 +5,6 @@
namespace Icinga\Web\Form\Element;
use Zend_Form_Element;
use Icinga\Web\Form;
/**
* A note
@ -32,7 +31,15 @@ class Note extends Zend_Form_Element
*/
public function init()
{
$this->setDecorators(Form::$defaultElementDecorators);
if (count($this->getDecorators()) === 0) {
$this->setDecorators(array(
'ViewHelper',
array(
'HtmlTag',
array('tag' => 'p')
)
));
}
}
/**