Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
17002 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\Page;
6
 
7
use Laminas\Form\Form;
8
use Laminas\Db\Adapter\AdapterInterface;
9
use Laminas\Log\LoggerInterface;
10
use LeadersLinked\Mapper\CompanySizeMapper;
11
use LeadersLinked\Mapper\IndustryMapper;
12
 
13
class PageForm extends Form
14
{
15
 
16
    public function __construct()
17
    {
18
        parent::__construct();
19
        $this->setInputFilter(new PageFilter());
20
 
21
        $this->add([
22
            'name' => 'code',
23
            'type' => \Laminas\Form\Element\Text::class,
24
            'attributes' => [
25
                'maxlength' 	=> '64',
26
                'id' 			=> 'code',
27
            ]
28
        ]);
29
 
30
        $this->add([
31
            'name' => 'title',
32
            'type' => \Laminas\Form\Element\Text::class,
33
            'attributes' => [
34
                'maxlength' 	=> 128,
35
                'id' 			=> 'title',
36
            ]
37
        ]);
38
 
39
        $this->add([
40
            'name' => 'content',
41
            'type' => \Laminas\Form\Element\Textarea::class,
42
            'attributes' => [
43
                'id'    => 'content',
44
            ]
45
        ]);
46
 
47
        $this->add([
48
             'name' => 'type',
49
             'type' => \Laminas\Form\Element\Select::class,
50
             'options' => [
51
                 'value_options' => [
52
                     \LeadersLinked\Model\Page::TYPE_PAGE => 'LABEL_PAGE',
53
                     \LeadersLinked\Model\Page::TYPE_URL => 'LABEL_URL',
54
                 ]
55
             ],
56
             'attributes' => [
57
                 'id' => 'type',
58
             ]
59
         ]);
60
 
61
        $this->add([
62
            'name' => 'url',
63
            'type' => \Laminas\Form\Element\Text::class,
64
            'attributes' => [
65
                'maxlength' 	=> 255,
66
                'id' 			=> 'url',
67
            ]
68
        ]);
69
 
70
        $this->add([
71
            'name' => 'status',
72
            'type' => \Laminas\Form\Element\Checkbox::class,
73
            'attributes' => [
74
                'id' 			=> 'status',
75
            ],
76
            'options' => [
77
                'use_hidden_element' => false,
78
                'unchecked_value' => \LeadersLinked\Model\Page::STATUS_INACTIVE,
79
                'checked_value'=> \LeadersLinked\Model\Page::STATUS_ACTIVE,
80
            ]
81
        ]);
82
    }
83
}