如何更改FormType.php Symfony 4中的输入“ id”

问题描述 投票:0回答:1

我已经尝试在FormType.php文件中更改attr “ id”

->add('content', TextareaType::class,([
            'label' => "Description détaillée",
            'attr' => [
                'placeholder' => "Donnez une description qui donne vraiment envoe de venir chez vous !",
                'id' => "test_id"
                ]
            ]))

NB:我只想更改“ ID”] >>

谢谢

我试图在FormType.php文件中更改attr“ id”:-> add('content',TextareaType :: class,([['label'=>“ Descriptiondétaillée”,'attr'=> [ '...

forms symfony4 symfony-4.4
1个回答
0
投票

您无法在控制器中添加id,但可以在视图中添加它,如下所示:

© www.soinside.com 2019 - 2024. All rights reserved.