cfwheels文档指出,要使用hasManyRadioButton(),属性字段是必需的。但在他们的示例中,他们没有使用属性。
以下是cfwheels文档提供的example。
<!--- Show radio buttons for associating a default address with the current author --->
<cfloop query="addresses">
#hasManyRadioButton(
label=addresses.title,
objectName="author",
association="authorsDefaultAddresses",
keys="#author.key()#,#addresses.id#"
)#
</cfloop>property属性是否是必需的?使用此函数的正确约定是什么?
发布于 2013-05-29 21:12:59
我认为property参数是必需的。这个例子似乎并不完整。
文档应该看起来像这样:
<!--- Show radio buttons for associating a default address with the current author --->
<cfloop query="addresses">
#hasManyRadioButton(
label=addresses.title,
objectName="author",
association="authorAddresses",
keys="#author.key()#,#addresses.id#",
property="isDefault",
tagValue=true
)#
</cfloop>注意,我更改了association参数,以表明它可能是一个连接author和address的连接表。我还添加了property和tagValue参数。
在本例中,单选按钮设置子对象(在本例中为authorAddress模型)上的一些值。
https://stackoverflow.com/questions/16807959
复制相似问题