form_label([$label_text = ''[, $id = ''[, $attributes = array()]]])
Parameters: |
|
---|---|
Returns: |
An HTML field label tag |
Return type: |
string |
Lets you generate a <label>. Simple example:
1 2 | 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:
1 2 3 4 5 6 7 | $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.