Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony2 FOSUserBundle自定义注册字段_Php_Symfony_Fosuserbundle - Fatal编程技术网

Php Symfony2 FOSUserBundle自定义注册字段

Php Symfony2 FOSUserBundle自定义注册字段,php,symfony,fosuserbundle,Php,Symfony,Fosuserbundle,我有默认的FOSUserBundle登记表。我想在注册表中添加“jabber”字段,这是可选的(不需要填写) 用户实体: protected $jabber; /** * @ORM\Column(type="string", length="100") */ 但当我尝试它的时候,我不能在没有填写“jabber”字段的情况下注册。我怎样才能不必填写该字段 您必须将其标记为可空: /** * @ORM\Column(type="string", length="100", nullable=

我有默认的FOSUserBundle登记表。我想在注册表中添加“jabber”字段,这是可选的(不需要填写)

用户实体:

protected $jabber;
/**
 * @ORM\Column(type="string", length="100")
 */

但当我尝试它的时候,我不能在没有填写“jabber”字段的情况下注册。我怎样才能不必填写该字段

您必须将其标记为可空:

/**
 * @ORM\Column(type="string", length="100", nullable="true")
 */
protected $jabber;

您必须将其标记为可为空:

/**
 * @ORM\Column(type="string", length="100", nullable="true")
 */
protected $jabber;