Password Input
There are two ways of adding a password field to your form object:
password (string name [, string value])
- name: defines the elements name attribute, should be unique in the object | required
- value: defines the default field value | not recommend for password fields!
Example:
$this->goodform->password('my_pass');
Will produce the following HTML:
<input name="my_pass" value="" type="password" />
password (array attributes)
- attributes: an associative array specifying attributes of the field element.
All attributes in this array will be converted to HTML element attributes. GoodForm will not check if these attributes are HTML valid. The only exceptions to this are the Special attributes that are not passed to the elements attribute string.
Example:
$attr = array(
'name' => 'my_pass',
'class' => 'my-password-class',
'size' => '20'
);
$this->goodform->password($attr);
Will produce the following HTML:
<input name="my_pass" value="" class="my-password-class" size="20" type="password" />