Proyectos de Subversion LeadersLinked - Backend

Rev

Autoría | Ultima modificación | Ver Log |

<?php

declare(strict_types=1);

namespace LeadersLinked\Form\Microlearning;

use Laminas\Form\Form;
use Laminas\Db\Adapter\AdapterInterface;
use Laminas\Log\LoggerInterface;
use LeadersLinked\Mapper\CompanySizeMapper;
use LeadersLinked\Mapper\IndustryMapper;
use LeadersLinked\Model\MicrolearningQuestion;


class QuestionCreateOrEditForm extends Form
{

    public function __construct() 
    {
        parent::__construct();
        $this->setInputFilter(new QuestionCreateOrEditFilter());
        

        
        $this->add([
            'name' => 'text',
            'type' => \Laminas\Form\Element\Textarea::class,
            'attributes' => [
                'id'    => 'text',
            ]
        ]);
        
        $this->add([
            'name' => 'type',
            'type' => \Laminas\Form\Element\Select::class,
            'options' => [
                'empty_option' => 'LABEL_TYPE',
                'value_options' => [
                    MicrolearningQuestion::TYPE_SINGLE_LINE => 'LABEL_SINGLE_LINE',
                    MicrolearningQuestion::TYPE_MULTI_LINE => 'LABEL_MULTI_LINE',
                    MicrolearningQuestion::TYPE_SINGLE_SELECTION => 'LABEL_SINGLE_SELECTION',
                    MicrolearningQuestion::TYPE_MULTIPLE_SELECTION => 'LABEL_MULTIPLE_SELECTION',
                    MicrolearningQuestion::TYPE_RANGE_1_5 => 'LABEL_RANGE_1_5',
                    MicrolearningQuestion::TYPE_RANGE_1_6 => 'LABEL_RANGE_1_6',
                    MicrolearningQuestion::TYPE_RANGE_1_10 => 'LABEL_RANGE_1_10',
                    MicrolearningQuestion::TYPE_RANGE_OPEN => 'LABEL_RANGE_OPEN',
                ]
            ],
            'attributes' => [
                'id' => 'type',
            ]
        ]);
        
        $this->add([
            'name' => 'maxlength',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'maxlength'     => 8,
                'id'                    => 'maxlength',
            ]
        ]);


        $this->add([
            'name' => 'points',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'maxlength'     => 3,
                'id'                    => 'points',
            ]
        ]);
    }
}