Form/Items/HiddenItem.php
public static function getItem(FormBuilderInterface $builder, array $item)
    {
        $attributes = [];

        if (isset($item['twig_variable']) && $item['twig_variable']) {
            $attributes['twig_variable'] = $item['twig_variable'];
        }

        $options = [
            'label' => false,
            'required' => $item['required'] ?? false,
            'attr' => $attributes,
            'constraints' => [],
        ];

        if (isset($item['required']) && $item['required']) {
            $options['constraints'][] = new NotBlank();
        }

        if (isset($item['read_only']) && $item['read_only']) {
            // Do not add the element add all. Default data remains unchanged.
        } else {
            $builder->add($item['name'], HiddenType::class, $options);
        }
    }
public static function getItem(FormBuilderInterface $builder, array $item)
    {
        $attributes = [];

        if (isset($item['twig_variable']) && $item['twig_variable']) {
            $attributes['twig_variable'] = $item['twig_variable'];
        }

        $options = [
            'label' => false,
            'required' => $item['required'] ?? false,
            'attr' => $attributes,
            'constraints' => [],
        ];

        if (isset($item['required']) && $item['required']) {
            $options['constraints'][] = new NotBlank();
        }

        if (isset($item['read_only']) && $item['read_only']) {
            // Do not add the element add all. Default data remains unchanged.
        } else {
            $builder->add($item['name'], HiddenType::class, $options);
        }
    }
{@inheritdoc}