Upload Input
There are two ways of adding an upload field to your form object:
upload (string name)
- name: defines the elements name attribute, should be unique in the object | required
Example:
$this->goodform->upload('my_pass');
Will produce the following HTML:
<input name="my_pass" value="" type="upload" />
upload (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-upload-class',
'size' => '20'
);
$this->goodform->upload($attr);
Will produce the following HTML:
<input name="my_pass" value="" class="my-upload-class" size="20" type="upload" />