kematjaya/hidden-type-bundle

form type for hidden values

1.3 2022-09-24 03:15 UTC

This package is auto-updated.

Last update: 2024-04-24 06:53:52 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
            ]);

    }
}