Skip to content
Snippets Groups Projects
Select Git revision
  • fa1a0c078fb8fabfe23cee44ec2bf869a2207a07
  • master default protected
  • release_3.0.0
  • test
  • feature_pre_sql
  • develop
  • 3.0.1
  • 3.0.0
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.3.7
  • 1.3.6
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.6
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
26 results

development.config.php.dist

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    OseForm.php 1.69 KiB
    <?php
    
    namespace <namespace>;
    
    <if useSubForm>
    use Application\Form\AbstractForm;
    <endif useSubForm>
    <if useHydrator>
    use Zend\Stdlib\Hydrator\HydratorInterface;
    <endif useHydrator>
    
    
    
    /**
     * Description of <classname>
     *
     * @author <author>
     */
    class <classname> extends AbstractForm
    {
    
        public function init()
        {
            <if useHydrator>
            $hydrator = new <classname>Hydrator;
            $this->setHydrator($hydrator);
            <endif useHydrator>
    
            $this->setAttribute('action',$this->getCurrentUrl());
    
            /* Ajoutez vos éléments de formulaire ici */
    
            $this->add([
                'name'       => 'submit',
                'type'       => 'Submit',
                'attributes' => [
                    'value' => 'Enregistrer',
                    'class' => 'btn btn-primary',
                ],
            ]);
        }
    
    
    
        /**
         * Should return an array specification compatible with
         * {@link Zend\InputFilter\Factory::createInputFilter()}.
         *
         * @return array
         */
        public function getInputFilterSpecification()
        {
            return [
                /* Filtres et validateurs */
            ];
        }
    }
    
    
    
    
    
    <if useHydrator>
    class <classname>Hydrator implements HydratorInterface
    {
    
        /**
         * @param  array    $data
         * @param           $object
         *
         * @return object
         */
        public function hydrate(array $data, $object)
        {
            /* on peuple l'objet à partir du tableau de données */
    
            return $object;
        }
    
    
    
        /**
         * @param  $object
         *
         * @return array
         */
        public function extract($object)
        {
            $data = [
                /* On peuple le tableau avec les données de l'objet */
            ];
    
            return $data;
        }
    }
    <endif useHydrator>