Add class attribute to Form Errors

后端 未结 6 2027
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 09:15

I´m developing an application using Zend Framework 2 and I use FormRow helper to render a label, the input and errors (if present) in a Form.



        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 09:26

    FormRow check if "form_element_errors" plugin registered. And if so use it as default to display error messages.

    So Sam's example work. You should redefine standard plugin and inform mvc about it.

    I'v done it in module.config.php

    'view_helpers' => array(
    'invokables' => array(
        'formElementErrors'=> 'MyModule\View\Helper\FormElementErrors',
    

    and FormRow start display errors as I wish :)

提交回复
热议问题