1
我開始一個新項目,使用symfony2 architercture和有用的FosUserBundle來處理我的用戶。FOSUserBundle:處理不同類型的用戶
在我的應用程序中,我有兩種不同類型的用戶,分別是:用戶和企業用戶。
我創建了一個用戶窗體(帶有嵌入窗體)。 現在我想創建一個EntrepriseForm(使用不同的嵌入式表單),但由於FosUserConfiguration只允許1個註冊表單類型,我被卡住了。
如果它可以幫助,這是我的config.yml看起來像:
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Digin\UserBundle\Entity\User
registration:
confirmation:
from_email: # Use this node only if you don't want the global email address for the confirmation email
address: [email protected]
sender_name: xxx
enabled: true # change to true for required email confirmation
template: FOSUserBundle:Registration:email.txt.twig
form:
type: mybundle_user_registration
handler: fos_user.registration.form.handler.default
name: fos_user_registration_form
validation_groups: [Registration]
約我應該怎麼做,你知道嗎?