参考Codeigniter用户指南http://codeigniter.com/user_guide/helpers/form_helper.html,我似乎不知道如何使用CI的表单助手设置表单的"name"属性。通过传入数组只能设置"id"。是否可以在不将数组传递给form_open()函数的情况下设置表单的"name"?
您可以使用此方法
$attributes = array('name' => 'myform');
echo form_open('email/send', $attributes);
表单的name属性实际上已被弃用:
17.3 FORM元素
[….]
name = cdata [CI] This attribute names the element so that it may be referred to
来自样式表或脚本。笔记此属性已包含于向后兼容性。应用程序应该使用id属性识别元素。
来源:W3.org
如果你真的想通过它,我担心你别无选择,只能使用你想避免的数组,正如你在手册中所读的那样。