未知实体名称空间别名“ PirastruFormBuilderBundle” [英] Unknown Entity namespace alias 'PirastruFormBuilderBundle'
问题描述
现在已经两天了,我正在寻找此错误的解决方案,但徒劳无功:
It has been now 2 days that i'm looking for a solution to this error but in vain :
未知实体名称空间别名'PirastruFormBuilderBundle'
Unknown Entity namespace alias 'PirastruFormBuilderBundle'
事实上,我使用作曲家安装了带有奏鸣曲页面捆绑程序的奏鸣曲表单生成器,但我不知道为什么。我得到这个错误。
in fact i installed the sonata form builder with sonata page bundle using the composer but i don't know why i'm getting this error.
我不知道我应该在这里复制哪一部分代码,所以请不要犹豫,问我
i don't know which part of codes should i copie here so please don't hesitate to ask me for it
sonata_form_builder:
resource: '@PirastruFormBuilderBundle/Controller/FormBuilderController.php'
type: annotation
谢谢!!
编辑
当我运行此命令时:php app / console config:dump-reference
when i run this : php app/console config:dump-reference
PirastruFormBuilderBundle | pirastru_form_builder |
PirastruFormBuilderBundle | pirastru_form_builder |
,当我运行此命令时:php app / console doctrine:mapping:info我得到了
and when i run this : php app/console doctrine:mapping:info i got
[异常]根据当前配置,您没有任何映射的Doctrine ORM实体
。如果您有实体或
映射文件,则应检查映射配置是否有错误。
[Exception] You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for errors.
好吧,我设法解决了这个问题!我只需要在FormBuilderBlockService中添加getManager
well i managed to solve the problem ! i had just to add a getManager in my FormBuilderBlockService
推荐答案
此问题可能是由某些(错误)配置引起的:
This problem can be caused by some (mis)configurations :
捆绑包
app/console config:dump-reference
此命令让您知道是否引用了Bundle。
This command let you know if the Bundle is referenced.
映射
app/console doctrine:mapping:info
此命令让您知道捆绑包是否已映射。
This command let you know if the Bundle is mapped.
通常是映射问题:
未知实体名称空间别名'*** Bundle'
Unknown Entity namespace alias '***Bundle'
更好的解决方案是在 config.yml
中将auto_mapping添加为true,如下所示:
The better solution is to add auto_mapping to true in config.yml
, like this :
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
但是可以通过其他方式解决,您可以请参阅:
But it can be solved by others way, you can have a look to : Symfony : What is the meaning of auto_mapping and auto_generate_proxy_classes
最好的问候,
这篇关于未知实体名称空间别名“ PirastruFormBuilderBundle”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!