Proyectos de Subversion LeadersLinked - Backend

Rev

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

<?php

declare(strict_types=1);

namespace LeadersLinked\Form\Post;

use Laminas\Form\Form;


class PostCreateForm extends Form
{

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

        $this->add([
            'name' => 'status',
            'type' => \Laminas\Form\Element\Checkbox::class,
            'attributes' => [
                'id'                    => 'status',
            ],
            'options' => [
                'use_hidden_element' => false,
                'unchecked_value' => \LeadersLinked\Model\CompanySize::STATUS_INACTIVE,
                'checked_value'=> \LeadersLinked\Model\CompanySize::STATUS_ACTIVE,
            ]
        ]);
        
        
        $this->add([
            'name' => 'title',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'maxlength'     => 128,
                'id'                    => 'title',
            ]
        ]);
        
        
        
        $this->add([
            'name' => 'description',
            'type' => \Laminas\Form\Element\Textarea::class,
            'attributes' => [
                'id'    => 'description',
            ]
        ]);
        
        $this->add([
            'name' => 'url',
            'type' => \Laminas\Form\Element\Url::class,
            'attributes' => [
                'maxlength'     => 250,
                'id'                    => 'url',
            ]
        ]);
        
        $this->add([
            'name' => 'date',
            'type' => \Laminas\Form\Element\Text::class,
            'attributes' => [
                'maxlength'     => 10,
                'id'                    => 'date',
            ]
        ]);
        
        
        $this->add([
            'name' => 'image',
            'type' => \Laminas\Form\Element\File::class,
            'attributes' => [
                'id' => 'image',
            ]
        ]);
        
        $this->add([
            'name' => 'file',
            'type' => \Laminas\Form\Element\File::class,
             'attributes' => [
                'id' => 'file',
            ]
         ]);
        
    }
}