* // create a new form
* $form = new Zebra_Form('my_form');
*
* // add a file upload control to the form
* $obj = $form->add('file', 'my_file_upload');
*
* // don't forget to always call this method before rendering the form
* if ($form->validate()) {
*
* // all the information about the uploaded file will be
* // available in the "file_upload" property
* print_r('');
* print_r($form->file_upload['my_file_upload']);
*
* }
*
* // output the form using an automatically generated template
* $form->render();
*
*
* @param string $id Unique name to identify the control in the form.
*
* The control's name attribute will be the same as the id attribute!
*
* This is the name to be used when referring to the control's value in the
* POST/GET superglobals, after the form is submitted.
*
* This is also the name of the variable to be used in custom template files, in
* order to display the control.
*
*
* // in a template file, in order to print the generated HTML
* // for a control named "my_file_upload", one would use:
* echo $my_file_upload;
*
*
* @param array $attributes (Optional) An array of attributes valid for
* {@link http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4 input}
* controls (size, readonly, style, etc)
*
* Must be specified as an associative array, in the form of attribute => value.
*
* // setting the "disabled" attribute
* $obj = $form->add(
* 'file',
* 'my_file_upload',
* '',
* array(
* 'disabled' => 'disabled'
* )
* );
*
*
* See {@link Zebra_Form_Control::set_attributes() set_attributes()} on how to set
* attributes, other than through the constructor.
*
* The following attributes are automatically set when the control is created and
* should not be altered manually: