我正在尝试按照以下文档为Symfony 4.3设置FOSUserBundle 2.0:https://symfony.com/doc/2.1/bundles/FOSUserBundle/index.html
我创建了一个扩展成员FOSUser的新成员类,如文档中所述:
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
class NewMember extends BaseUser
{
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="displayName", type="string", length=50, nullable=true)
*/
protected $displayName;
我在fos_user.yaml中配置user_class:
# config/packages/fos_user.yaml
fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: main
user_class: App\Entity\Main\NewMember
from_email:
address: "test@domain.com"
sender_name: "test@domain.com"
我使用 fos_user.registration.form.factory ,但是无论我做什么,我的注册表格始终具有相同的字段:
Email
Username
Password
Repeat password
感谢您的帮助。先感谢您。