kematjaya/hidden-type-bundle

form type for hidden values

7.0 2024-10-22 03:38 UTC

This package is auto-updated.

Last update: 2024-11-22 03:53:32 UTC


README

  1. Installation
composer require kematjaya/hidden-type-bundle
  1. usage
<?php

namespace App\Form;

...
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Kematjaya\HiddenTypeBundle\Type\HiddenDateTimeType;
use Kematjaya\HiddenTypeBundle\Type\HiddenEntityType;
...

class FooType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('created_at', HiddenDateTimeType::class)
            ->add('store', HiddenEntityType::class, [
                'class' => \App\Entity\Store::class
            ]);

    }
}