Beruflich Dokumente
Kultur Dokumente
1 <?php
2 namespace ZfDeals\Form;
3
4 use Zend\Form\Fieldset;
5 use Zend\InputFilter\InputFilterInterface;
6 use Zend\InputFilter\InputFilterProviderInterface;
7
8 class ProductFieldset extends Fieldset
9 implements InputFilterProviderInterface
10 {
11 public function __construct()
12 {
13 parent::__construct('product');
14
15 $this->add(array(
16 'name' => 'id',
17 'attributes' => array(
18 'type' => 'text',
19 ),
20 'options' => array(
21 'label' => 'Produkt-ID:',
22 )
23 ));
24
25
26 $this->add(array(
27 'name' => 'name',
28 'attributes' => array(
29 'type' => 'text',
30 ),
31 'options' => array(
32 'label' => 'Produktbezeichnung:',
33 )
34 ));
35
36 $this->add(array(
37 'name' => 'stock',
38 'attributes' => array(
39 'type' => 'number',
40 ),
41 'options' => array(
42 'label' => '# Bestand:'
Developers Dairy 206
43 ),
44 ));
45 }
46
47 public function getInputFilterSpecification()
48 {
49 return array(
50 'id' => array (
51 'required' => true,
52 'filters' => array(
53 array(
Listing 26.9