0
我有我的模型實體保存在src/AppBundle/Model/Entity
。security.yml中的未知實體命名空間與Symfony中的自定義實體文件夾2
你可以理解,我有自己的實體文件夾(在模型文件夾中)。
這是config.yml我的ORM的設置:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: false
mappings:
user:
type: annotation
dir: %kernel.root_dir%/../src/AppBundle/Model/Entity
alias: 'Entity'
prefix: AppBundle\Model\Entity
is_bundle: false
我與這些線在我security.yml
一個問題:
providers:
our_db_provider:
entity:
class: AppBundle:User
property: username
# if you're using multiple entity managers
# manager_name: customer
有一些錯誤:
Unknown Entity namespace alias 'AppBundle'.
我不需要使用什麼參考(AppBundle:User
可能不是)。
謝謝你的回答。
你試過'的appbundle \模式l \ Entity \ User'?您也可以嘗試將前綴更改爲'AppBundle:'不確定它是否會起作用。 –
謝謝瓦迪姆,我試過了,它工作。對不起,我是Symfony的初學者,有時候我在基礎知識方面有問題(路由,參考等) –