Zend Form Rendering and Decorators (Use correctly with bootstrap)

荒凉一梦 提交于 2019-12-08 16:27:33

I assume you are using ZF2 FormRow view helper to render your form element in your view script, e.g. $this->formRow($this->form->get('email_address'));

To render it differently you need to use the following view helpers

FormLabel

FormText

FormElementErrors

If for example you wanted to render as a definition list you would use something like

<dl class="zend_form">
    <dt><?php echo $this->formLabel($this->form->get('email_address')); ?></dt>
    <dd><?php echo $this->formText($this->form->get('email_address')); ?>
        <?php echo $this->formElementErrors($this->form->get('email_address')); ?></dd>
</dl>

I hope this points you in the right direction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!