如何在這個笨添加類PLS任何一個可以幫助我解決問題 我想添加這個類在這一行類=「表單控制」要添加一類笨形式
<?php echo form_input('username', 'Username'); ?>
如何在這個笨添加類PLS任何一個可以幫助我解決問題 我想添加這個類在這一行類=「表單控制」要添加一類笨形式
<?php echo form_input('username', 'Username'); ?>
請嘗試此操作
echo form_input('username', 'Username',"class='class_name'");
請閱讀文檔以瞭解更多信息,因爲答案就在那裏。 (http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html)。
您可以通過form_input
將關聯數組與您想要的屬性相關聯。
$attrs = array(
'name'=>'username',
'value'=>'Username',
'class'=>'form-control',
);
echo form_input($attrs);
嘗試這樣的事情
<?php echo form_input('username', 'Username','class="class_name"'); ?>
OR
$data = array(
'name' => 'username',
'id' => 'username',
'value' => 'johndoe',
'maxlength' => '100',
'size' => '50',
'style' => 'width:50%',
'class' => 'class_name',
);
echo form_input($data);
// Would produce:
<input type="text" name="username" id="username" class="class_name" value="johndoe" maxlength="100" size="50" style="width:50%" />