Symfony form differences between row and widget

非 Y 不嫁゛ 提交于 2021-02-07 11:06:58

问题


What is the differences between form_widget and form_row?

I know that in form_row i can add label in attributes, and form_widget render all fields.

are there others difference?


回答1:


From documentation:

form_widget

Renders the HTML widget of a given field. If you apply this to an entire form or collection of fields, each underlying form row will be rendered.

form_row

Renders the "row" of a given field, which is the combination of the field's label, errors and widget.

So main difference is that form_widget will render also child fields (if they exists).



来源:https://stackoverflow.com/questions/36199364/symfony-form-differences-between-row-and-widget

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