// instead of using
'label' => 'field name here'
// use
array('label' => 'field name here', 'class' => 'form-horizontal')
protected static $_properties = array(
'date' => array(
'type' => 'date',
'validation' => array(
'required'
),
'form' => array(
'label' => 'Invoice date',
'class' => 'small datepicker',
'readonly',
),
),
);
protected static $_properties = array(
'date' => array(
'type' => 'date',
'validation' => array(
'required'
),
'form' => array(
'label' => array('label' => 'Invoice date', 'class' => 'form-horizontal'),
'class' => 'small datepicker',
'readonly',
),
),
);
protected static $_properties = array(
'id',
'username' => array( //column name
'data_type' => 'varchar',
'label' => 'Username',
'form' => array(
'description' => ' Your username', //inline text
),
'validation' => array('required', 'max_length'=>array(50), 'unique'=>array('users.username')) //validation rules
),
'username' => array( //column name
'data_type' => 'varchar',
//'label'=>'Username',
array('label'=>'Username', 'class'=>'control-label'),
'form' => array(
'description' => ' Your username', //inline text
),
'validation' => array('required', 'max_length'=>array(50), 'unique'=>array('users.username')) //validation rules
),
'username' => array( //column name
'data_type' => 'varchar',
//'label'=>'Username',
'form' => array(
'description' => ' Your username', //inline text
'label' =>array('label'=>'Username', 'class'=>'control-label'),
),
'validation' => array('required', 'max_length'=>array(50), 'unique'=>array('users.username')) //validation rules
),
public function label($label, $id = null, array $attributes = array())
{
if (is_array($label))
{
$attributes = $label;
$label = $attributes['label'];
isset($attributes['id']) and $id = $attributes['id'];
}
if (empty($attributes['for']) and $this->get_config('auto_id', false) == true)
{
$attributes['for'] = $this->get_config('auto_id_prefix', 'form_').$id;
}
unset($attributes['label']);
unset($attributes['id']);
return html_tag('label', $attributes, \Lang::get($label) ?: $label);
}
'username' => array( //column name
'data_type' => 'varchar',
'label' => array('label'=>'Username', 'class'=>'control-label'), //label for the input field
'form' => array(
//'description' => ' Your username', //inline text
),
'validation' => array('required', 'max_length'=>array(50), 'unique'=>array('users.username')) //validation rules
),
ErrorException [ Notice ]: Undefined index: label COREPATH/classes/form/instance.php @ line 593
unset($attributes['label']); unset($attributes['id']);
\fuel\core\config\form.php - Here you can set your templateprichard wrote on Tuesday 22nd of May 2012:Hello,
I try to use the fieldset class with the bootstrap twitter, bur I have some problem. how can I ?
- add class="control-label"
- add <p class="help-block">Supporting help text </p>
- and create a special template for button in app/config/form.php because de div class for fields and button are different Thanks
<form class="form-horizontal">
<fieldset>
<legend>Legend text </legend>
<div class="control-group">
<label class="control-label" for="input01">Text input </label>
<div class="controls">
<input type="text" class="input-xlarge" id="input01">
<p class="help-block">Supporting help text </p>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
</div>
</fieldset>
</form>
It looks like you're new here. If you want to get involved, click one of these buttons!