只是想知道如何使用formbuilder在html树枝中创建表单时可以从标签中分离文本框?表单工作正常,但我想要对齐每个新的文本框和前面的文本,这样看起来就不那么草率了。有没有一种方法可以渲染表单,然后设计它?我使用php来创建FormBuilder的表单,并用树枝渲染。造型我的形式在树枝&php
php的创建形式是这样的:
$form = $this->createFormBuilder(array('csrf_protection' => false))
->add('username','text', array('label'=>'Username/Alias'))
->add('password','password',array('label'=>'Password'))
->add('ve','text',array('label'=>'Verification code'))
->getForm() ;
$request= $this->getRequest();
而且树枝看起来像这样:
<form action="{{path('myBundle_login')}}" method="post" enctype={{form_enctype(form)}}>
// the form_enctype(form) is the form that is sent through
{{ form_errors(form) }}
{{ form_widget(form) }}
{{ form_rest(form) }}
,但我只是希望它整齐地隔开......请帮助。