MartinFowler:的确,字典不是“明确的”。不过,如果你往类里添加一个字段,并把这个多出来的值放到字典里的话,不会有什么问题。
Martin Fowler: No a dictionary isn't as explicit, but if you add a field to the class and pump an extra value into the dictionary, it doesn't matter.
为了让它运转起来,你需要做的只是把“hidden”字段的值改成你网站的域名。
To make it work, all you need to do is change the value of the "hidden" field to your website's domain name.
这种校验会通过拒绝空值,强迫加上非空[notNULL]字段的约束,但是也只有在这种情况下,你的数据库会拒绝空值。
This new validation will enforce NOT null column constraints by rejecting null values, but only in situations where your database would reject a null value.
或者你使用了一个VARCHAR字段,你可能得到建议让你转化为ENUM,如果它只拥有很少的值。
Or if you are using a VARCHAR field, you might get a suggestion to convert it to ENUM, if there are only few unique values.
编辑如果你想要显示的值被传递的形式,但不明显可编辑的,你必须把它作为一个隐藏字段。
Edit If you want to have the displayed value to be passed in the form, but not "visibly editable", you've got to pass it as an hidden field.
编辑如果你想要显示的值被传递的形式,但不明显可编辑的,你必须把它作为一个隐藏字段。
Edit If you want to have the displayed value to be passed in the form, but not "visibly editable", you've got to pass it as an hidden field.
应用推荐