양식 래퍼 사용자 정의 ID를 설정하는 데 문제가 있습니다. $ options [ 'attr'] [ 'id'] 작동하지 않는 것 같습니다. 의 CreateForm에 전달되는 모든 옵션() 메서드는 내가 심포니 2.1 베타에서 일하고 있어요 ... 무시 될 것으로 보인다 1Symfony2에서 기본 폼 ID를 사용자 정의하는 방법
양식 설정 :
{{ form_widget(login_form) }}
: 뷰에 전달
$login_form = $this->createForm(new LoginType(), $user, array(
'attr' => array(
'id' => 'login-form'
)
));
그러나 생산 :
<div id="login">
<div>
<label class="required">Mobile</label>
<input type="text" maxlength="255" required="required" name="login[mobile]" id="login_mobile">
</div>
<div>
<label class="required">Password</label>
<input type="text" maxlength="255" required="required" name="login[password]" id="login_password">
</div>
</div>
그래서 양식 래퍼 ID가 = "로그인"이, 인 "로그인 양식"
그래,하지만 여러 가지 양식이있는 경우 문제가 해결되지는 않습니다. 또한 이름 접두어가 예 : login [ 'password']를 login_form [ 'password']로 변경하십시오. 나는 html ID 속성을 –
내부에 삽입 된 양식으로 만 변경하려고합니다. –