1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
class UploadForm extends Zend_Form
{
public function __construct($options = null)
{
$this->addElementPrefixPath('App', 'App/');
parent::__construct($options);
$this->setName('upload');
$this->setAttrib('enctype', 'multipart/form-data');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name')
->setRequired(true)
->addValidator('NotEmpty');
$file = new App_Form_Element_File('Datafile');
$file->setRequired(true)
->addValidator('NotEmpty');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Upload');
$this->addElements(array($file, $submit));
}
}