Skip to content
Snippets Groups Projects
Select Git revision
  • f85e6c0113b4f5f0617d24d459ebf18c46f338eb
  • master default protected
  • alc-scindage-donnees-pj
  • b24
  • ll-workflow
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

install

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ContactController.php 1.72 KiB
    <?php
    
    namespace Exemple\Controller;
    
    use Exemple\Form\ContactMultipageForm;
    use UnicaenApp\Controller\Plugin\MultipageFormPlugin;
    use UnicaenApp\Form\MultipageForm;
    use Zend\Http\PhpEnvironment\Response;
    use Zend\Mvc\Controller\AbstractActionController;
    
    /**
     * @method MultipageFormPlugin multipageForm(MultipageForm $form)
     *
     * @author Unicaen
     */
    class ContactController extends AbstractActionController
    {
        /**
         * @var ContactMultipageForm
         */
        protected $form;
    
        public function __construct()
        {
            $this->form = new ContactMultipageForm('contact');
            $this->form->setActionPrefix('ajouter-');
        }
    
        public function ajouterAction()
        {
            return $this->multipageForm($this->form)->start(); // réinit du plugin et redirection vers la 1ère étape
        }
    
        public function ajouterIdentiteAction()
        {
            return $this->multipageForm($this->form)->process();
        }
    
        public function ajouterAdresseAction()
        {
            return $this->multipageForm($this->form)->process();
        }
    
        public function ajouterMessageAction()
        {
            return $this->multipageForm($this->form)->process();
        }
    
        public function ajouterAnnulerAction()
        {
            return $this->redirect()->toRoute('exemple/contact');
        }
    
        public function ajouterConfirmerAction()
        {
            $response = $this->multipageForm($this->form)->process();
            if ($response instanceof Response) {
                return $response;
            }
            return array('form' => $this->form);
        }
    
        public function ajouterEnregistrerAction()
        {
            $data = $this->multipageForm($this->form)->getFormSessionData();
            var_dump($data);
    //        return $this->redirect()->toRoute('home');
            return false;
        }
    }