Repository navigation
Expand file tree
/
Copy pathFleet.php
More file actions
52 lines (47 loc) · 1.6 KB
/
Copy pathFleet.php
File metadata and controls
52 lines (47 loc) · 1.6 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
class Default_Form_Fleet extends Zend_Form
{
/**
* init() is the initialization routine called when Zend_Form objects are
* created. In most cases, it make alot of sense to put definitions in this
* method, as you can see below. This is not required, but suggested.
* There might exist other application scenarios where one might want to
* configure their form objects in a different way, those are best
* described in the manual:
*
* @see http://framework.zend.com/manual/en/zend.form.html
* @return void
*/
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post');
// Add a place to put the fleet link
$this->addElement('text', 'fleetlink', array(
'label' => 'The fleet link:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'EmailAddress',
)
));
// Add a name element
$this->addElement('text', 'name', array(
'label' => 'Name of the fleet:',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
'EmailAddress',
)
));
// Add the submit button
$this->addElement('submit', 'submit', array(
'ignore' => true,
'label' => 'Add fleet',
));
// some CSRF protection
$this->addElement('hash', 'csrf', array(
'ignore' => true,
));
}
}