行和窗口小部件之间的Symfony形式差异 [英] Symfony form differences between row and widget

查看:47
本文介绍了行和窗口小部件之间的Symfony形式差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

form_widget form_row 之间有什么区别?

我知道在 form_row 中我可以在属性中添加标签,并且 form_widget 呈现所有字段.

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

还有其他区别吗?

推荐答案

来自文档:

form_widget

呈现给定字段的HTML小部件.如果您将此应用到整个表单或字段集合,每个基础表单行将是呈现.

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.

因此主要区别在于 form_widget 还将呈现子字段(如果存在).

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

这篇关于行和窗口小部件之间的Symfony形式差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆