3 回答
TA贡献1859条经验 获得超6个赞
您应该将输入属性编写为数组,如下所示:
<?php echo form_open_multipart('subscode');?>
<div class="form-group">
<label for="code" class="col-sm-3 control-label">Code:</label>
<div class="col-sm-12">
<?php echo form_input('inputcode','', ['class'=>'form-control','placeholder'=>'Input your code..']);?>
</div>
</div>
TA贡献1842条经验 获得超12个赞
你能传递一个包含你希望表单包含的数据的关联数组吗?喜欢
<?php
$data = array(
'name' => 'inputcode',
'class' => 'form-control',
'placeholder' => 'put your placeholder',
'size' => '50', //if necessary
'style' => 'width:50%' //if necessary
);
echo form_input($data);
?>
TA贡献1891条经验 获得超3个赞
在占位符中添加“”
<?php echo form_open_multipart('subscode');?>
<div class="form-group">
<label for="code" class="col-sm-3 control-label">Code:</label>
<div class="col-sm-12">
<?php echo form_input('inputcode','','class="form-control"','','placeholder="Input your code.."');?>
</div>
</div>...
?>
或添加到数组中:
$data = array(
'name' => 'inputcode',
'id' => 'inputcodeid',
'value' => 'test value',
'placeholder' => 'placeholder here',
);
echo form_input($data);
- 3 回答
- 0 关注
- 116 浏览
添加回答
举报