Skip to content
Snippets Groups Projects
Select Git revision
  • 9f5e33774d3d8f0319e4260819fe5dcab38a63f8
  • master default protected
  • cleanup_fixtures
  • add-openvox
  • freebsd-14
  • remove-legacy-top-scope-syntax
  • rel430
  • tests
  • revert-363-augeas-module-cleanup
  • release-4.1.0
  • puppet8
  • relax-dependencies
  • rel400
  • mode
  • puppet7
  • release-3.1.0
  • freebsd13
  • freebsd11
  • stdlib
  • centos
  • fedora
  • v5.1.0
  • v5.0.0
  • v4.5.0
  • v4.4.0
  • v4.3.0
  • v4.2.1
  • v4.2.0
  • v4.1.0
  • v4.0.0
  • v3.1.0
  • v3.0.0
  • v2.0.0
  • 1.12.0
  • 1.11.0
  • 1.10.0
  • 1.9.0
  • 1.8.0
  • 1.7.0
  • 1.6.0
  • 1.5.0
41 results

params.pp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    OseForm.php 1.68 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>