//-- this is my controller code------
$form = $this->createFormBuilder()
->add('curpass', 'password')
->add('password', 'repeated', array(
'type' => 'password',
'first_name' => " new Password",
'second_name' => "Re-enter Password",
'invalid_message' => 'The password fields must match.'
))
->getForm();
//----this is my twig code-----
<form action="#" method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}
<input type="submit" />
</form>
你能告訴我我的代碼有什麼問題嗎?它不會比較密碼字段'新密碼'和'重新輸入密碼'。在symfony2中無法驗證的重複字段
它打印什麼? – meze 2012-03-02 07:56:01