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\Microlearning;
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
use LeadersLinked\Model\MicrolearningQuestion;
13
 
14
 
15
class QuestionCreateOrEditForm extends Form
16
{
17
 
18
    public function __construct()
19
    {
20
        parent::__construct();
21
        $this->setInputFilter(new QuestionCreateOrEditFilter());
22
 
23
 
24
 
25
        $this->add([
26
            'name' => 'text',
27
            'type' => \Laminas\Form\Element\Textarea::class,
28
            'attributes' => [
29
                'id'    => 'text',
30
            ]
31
        ]);
32
 
33
        $this->add([
34
            'name' => 'type',
35
            'type' => \Laminas\Form\Element\Select::class,
36
            'options' => [
37
                'empty_option' => 'LABEL_TYPE',
38
                'value_options' => [
39
                    MicrolearningQuestion::TYPE_SINGLE_LINE => 'LABEL_SINGLE_LINE',
40
                    MicrolearningQuestion::TYPE_MULTI_LINE => 'LABEL_MULTI_LINE',
41
                    MicrolearningQuestion::TYPE_SINGLE_SELECTION => 'LABEL_SINGLE_SELECTION',
42
                    MicrolearningQuestion::TYPE_MULTIPLE_SELECTION => 'LABEL_MULTIPLE_SELECTION',
43
                    MicrolearningQuestion::TYPE_RANGE_1_5 => 'LABEL_RANGE_1_5',
44
                    MicrolearningQuestion::TYPE_RANGE_1_6 => 'LABEL_RANGE_1_6',
45
                    MicrolearningQuestion::TYPE_RANGE_1_10 => 'LABEL_RANGE_1_10',
46
                    MicrolearningQuestion::TYPE_RANGE_OPEN => 'LABEL_RANGE_OPEN',
47
                ]
48
            ],
49
            'attributes' => [
50
                'id' => 'type',
51
            ]
52
        ]);
53
 
54
        $this->add([
55
            'name' => 'maxlength',
56
            'type' => \Laminas\Form\Element\Text::class,
57
            'attributes' => [
58
                'maxlength' 	=> 8,
59
                'id' 			=> 'maxlength',
60
            ]
61
        ]);
62
 
63
 
64
        $this->add([
65
            'name' => 'points',
66
            'type' => \Laminas\Form\Element\Text::class,
67
            'attributes' => [
68
                'maxlength' 	=> 3,
69
                'id' 			=> 'points',
70
            ]
71
        ]);
72
    }
73
}