我无法让重复的字段类型不冒泡错误(例如,当字段不匹配时)到父主窗体。这里是$plain_password
属性:
/**
* @ORM\Entity
*/
class User implements
\Symfony\Component\Security\Core\User\AdvancedUserInterface, \Serializable
{
/**
* @Assert\NotBlank()
* @Assert\MinLength(limit=6)
* @Assert\MaxLength(limit=32)
*/
public $plain_password;
}
以及表格的相关部分:
$builder->add('plain_password', 'repeated', array(
'type' => 'password',
'first_name' => 'Password *',
'second_name' => 'Conferma password *',
));
当用户输入无效值时,错误将传递给父表单并呈现。请参阅Issue #1971,但它应该被关闭!