?? GreyFile — Mystic File Browser

Current path: home/webdevt/cryptoimpot.fr/module/Application/src/Form/



?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/src

?? Viewing: QuestionActiviteForm.php

<?php

namespace Application\Form;

use Laminas\Form\Element\Radio;
use Laminas\Form\Form;

/**
 * 
 */
class QuestionActiviteForm extends Form {

    // Constructor.   
    public function __construct() {
        // Define form name
        parent::__construct('question-form');

        // Set POST method for this form
        $this->setAttribute('method', 'post');

        // Add form elements
        $this->addElements();
    }

    // This method adds elements to form (input fields and 
    // submit button).
    private function addElements() {

        $this->add([
            'type' => Radio::class,
            'name' => 'q1',
            'label_attributes' => array(
                    'class' => 'qcm-choix',
                'id' => 'q1'
                ),
            'options' => [
                'label' => 'Exercez-vous une activité professionnelle en dehors des crypto-monnaies ?',
                'label_attributes' => array(
                    'class' => 'qcm-choix',
                    'id' => 'q1',
                    'for' => 'q1'
                    
                ),
               
                // more options
                'value_options' => [
                    '1' => 'Oui, je suis salarié à temps plein.',
                    '2' => 'Oui, je suis salarié à temps partiel.',
                    '3' => 'Oui, je suis fonctionnaire.',
                    '4' => 'Oui, je suis étudiant.',
                    '5' => "Oui, je suis à mon compte, je dispose d'un numéro Siret, et mon chiffre d'affaire réalisé chaque année est supérieur à 15000€.",
                    '6' => "Oui, je suis à mon compte, je dispose d'un numéro Siret, mais mon chiffre d'affaire réalisé chaque année est inférieur à 15000€.",
                    '7' => "Je suis en recherche de travail, indemnisé par Pôle Emploi.",
                    '8' => "Je suis en recherche de travail, non indemnisé par Pôle Emploi.",
                    '9' => "Non."
                ],
            ],
        ]);
        $this->add([
            'type' => Radio::class,
            'name' => 'q2',
            'label_attributes' => array(
                    'class' => 'qcm-choix'
                ),
            'options' => [
                'label' => "Mon activité professionnelle et/ou mes études me rendent familier de l'investissement en crypto-monnaies (informatique, finance…)",
                'label_attributes' => array(
                    'class' => 'qcm-choix'
                ),
                'value_options' => [
                    '1' => 'Non, pas du tout.',
                    '2' => 'Oui, un peu.',
                    '3' => 'Oui, clairement.',
//                    '4' => 'Je n\'ai pas d\'activité professionnelle.',
                ],
            ],
        ]);
        $this->add([
            'type' => Radio::class,
            'name' => 'q3',
            'options' => [
                'label' => "J'ai acquis mes premières crypto-monnaies",
                'label_attributes' => array(
                    'class' => 'qcm-choix'
                ),
                'value_options' => [
                    '1' => 'Dès le tout début, entre 2010 et 2011.',
                    '2' => 'Entre 2012 et 2014',
                    '3' => 'Entre 2015 et 2016..',
                    '4' => 'Entre 2017 et 2018.',
                    '5' => 'En 2019..',
                ],
            ],
        ]);
        // Add "email" field
//    $this->add([
//	        'type'  => 'text',
//            'name' => 'email',
//            'attributes' => [                
//                'id' => 'email'
//            ],
//            'options' => [
//                'label' => 'Votre emaill',
//            ],
//        ]);
//        
//    // Add "subject" field
//    $this->add([
//            'type'  => 'text',
//            'name' => 'name',
//            'attributes' => [
//              'id' => 'subject'  
//            ],
//            'options' => [
//                'label' => 'Nom',
//            ],
//        ]);
//    $this->add([
//            'type'  => 'text',
//            'name' => 'subject',
//            'attributes' => [
//              'id' => 'subject'  
//            ],
//            'options' => [
//                'label' => 'Sujet',
//            ],
//        ]);
//        
//    // Add "body" field
//    $this->add([
//            'type'  => 'textarea',
//            'name' => 'body',			
//            'attributes' => [                
//			  'id' => 'body'
//            ],
//            'options' => [
//                'label' => 'Message',
//            ],
//        ]);

        $this->add([
            'type' => 'csrf',
            'name' => 'csrf',
            'options' => [
                'csrf_options' => [
                    'timeout' => 6000
                ]
            ],
        ]);

        // Add the submit button
        $this->add([
            'type' => 'submit',
            'name' => 'submit',
            'attributes' => [
                'value' => 'Envoyer',
            ],
        ]);
    }

}


??

??