form_label([$label_text = ''[, $id = ''[, $attributes = array()]]])
Parameters: |
|
---|---|
Returns: |
An HTML field label tag |
Return type: |
string |
Lets you generate a <label>. Simple example:
echo form_label('What is your Name', 'username'); // Would produce: <label for="username">What is your Name</label>
Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.
Example:
$attributes = array( 'class' => 'mycustomclass', 'style' => 'color: #000;' ); echo form_label('What is your Name', 'username', $attributes); // Would produce: <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>
Please login to continue.