提交带有树枝的忽略所需表格行

  • 本文关键字:表格 提交 html twig
  • 更新时间 :
  • 英文 :


如何使用twig

添加所需的表格行

我已经使用了此代码,但是提交时不起作用

{{ form_row(form.prenom,{'attr': {'required': 'required'} }) }}

控制器

  $candidat = new Candidat();
    $form = $this->createForm(CandidatType::class, $candidat);
    ;
$this->render("cvtheque/ajouter_candidat.html.twig",['form' => $form->createView()])

您应该在形式的建筑物上指定它:

->add('prenom', TextType::class, [
            'label' => 'customer.edit.firstname',
            'required' => true
        ])

最新更新