开发者

How to wrap Zend_Form error message in custom html?

I need to wrap zend form error messages in custom html.

<div class="cerror" id="ID-error">
    <div class="ui-widget">
      开发者_StackOverflow中文版  <div class="ui-state-error ui-corner-all" id="IDerror-msg">
            %ZEND_FORM_ERROR_MESSAGE%
        </div>
    </div>
</div>

Now I get errors in format:

<ul>
    <li>Error message</li>
</ul>

I need:

<div class="cerror" id="EMAIL-error">
    <div class="ui-widget">
        <div class="ui-state-error ui-corner-all" id="EMAIL-error-msg">
            <ul>
                <li>Error message</li>
            </ul>
        </div>
    </div>
</div>

Thank you!

I have following code:

        $element->clearDecorators();
        $element->removeDecorator('DtDdWrapper');
        $element->addDecorator('ViewHelper');
        $element->addDecorator('Description', array('tag' => 'p', 'class' => 'description'));
        $element->addDecorator('Label', array('tag' => null));
        $element->addDecorator(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-line'));

How to wrap errors in 3 div tags? Thank!


    $element->clearDecorators();
    $element->addDecorator('Errors');
    $element->addDecorator(array('div1' => 'HtmlTag'), array('tag' => 'div',
                    'class' => 'cerror', 'id' => 'EMAIL-error'));
    $element->addDecorator(array('div2' => 'HtmlTag'), array('tag' => 'div',
                    'class' => 'ui-widget'));
    $element->addDecorator(array('div3' => 'HtmlTag'), array('tag' => 'div',
                    'class' => 'ui-state-error ui-corner-all',
                    'id' => 'EMAIL-error-msg'));
    $element->addDecorator('ViewHelper');
    $element->addDecorator('Description', array('tag' => 'p', 'class' => 'description'));
    $element->addDecorator('Label', array('tag' => null));
    $element->addDecorator(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-line'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜