HTML表单命名约定的名称 [英] Names of HTML form naming conventions
问题描述
在Rails和CakePHP1.2中,表单往往包括具有如下名称的输入元素:
< input name =comment [author]/>
name属性中使用的符号是否有正式名称?
同样,在CakePHP1.1中,我相信这看起来像这样:
< input name =comment / author/>
同样,在name属性中使用的符号是否有正式名称?
在蛋糕php,命名方案是多维数组访问格式,虽然我不知道你会叫什么。多维数组键控?
官方php文档调用它方括号符号
基本上,我不知道cakephp有一个特定的名称为这...这是因为它是简单的括号符号的键盘数组访问。
这是cakephp文档的一个例子。它说明了在cakephp中用括号符号命名元素,以及如何使用它来预填充值。
使用蛋糕php FormHelper我们创建一个隐藏的id字段:
echo $ this-> Form-> hidden('id'):
:
<! - data来自$ this-> request-> data -
< input name =data [User] [id]id =UserIdtype =hidden/>
假设 In Rails and CakePHP1.2, forms tend to include input elements with names like the following: Is there a formal name for the notation used in the "name" attribute? Likewise, in CakePHP1.1 I do believe that the same would have looked like this: Again, is there a formal name for the notation used in the "name" attribute? in cake php, the naming scheme is in multidimensional array access format, though i'm not really sure what you'd call that. multidimensional array keying? official php docs call it "square bracket notation" Basically, I'm not sure that cakephp has a specific name for this... This is because it is simply 'bracket notation' for keyed array access. Here's an example from the cakephp docs. It illustrates naming elements with bracket notation in cakephp, and how this is used to pre-populate values. using cake php FormHelper we create a hidden id field: this outputs the following: Assuming that the value held by 这篇关于HTML表单命名约定的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! data [User] [id] code>为
10
,ID为 UserId
的输入值为10。 p> <input name="comment[author]" />
<input name="comment/author" />
echo $this->Form->hidden('id'):
<!-- data comes from $this->request->data -->
<input name="data[User][id]" id="UserId" type="hidden" />
data[User][id]
is 10
, the input with an ID of UserId
will have a value of 10.