Symfony3:生成粗体不起作用 [英] Symfony3 : Generate crud doesn't work

查看:72
本文介绍了Symfony3:生成粗体不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的新symfony3项目中使用generate crud功能.我已经使用生成器,实体测试以及生成器创建了一个名为AdminBundle的捆绑包,所有捆绑包都处理到了最后.我检查了我的文件,在src/AdminBundle/Entity/Test.php文件夹下生成了我的类Test.php.一切都很好.

I'm trying to use the generate crud feature with my new symfony3 project. I have created a bundle named AdminBundle with the generator, the entity test, also with the generator, all processed well to the end. I checked my file under, i have my class Test.php generated under my src/AdminBundle/Entity/Test.php folder. All is working well.

但是当我尝试使用以下命令为我的测试实体的文档生成文档时:

But when i try to generate a crud following the doc for my test entity with the following command :

bin/console generate:doctrine:crud
The Entity shortcut name: AdminBundle:Test

我收到以下错误:

[RuntimeException] 实体"Test"在"AdminBundle"捆绑包中不存在.您可能输入了错误的包名称,或者该实体尚不存在(首先使用"doctrine:generate:entity" comm创建它 和).

[RuntimeException] Entity "Test" does not exist in the "AdminBundle" bundle. You may have mistyped the bundle name or maybe the entity doesn't exist yet (create it first with the "doctrine:generate:entity" comm and).

正如我所说,我已经使用"doctrine:generate:entity"命令生成了该实体,并且输入了与在crud生成器中键入的名称相同的名称(AdminBundle:Test).

As i said, i already generated the entity with the "doctrine:generate:entity" command, and i type the same name ( AdminBundle:Test ) as i type in my crud generator.

有什么想法吗?

推荐答案

我对sf2.8有相同的问题.

I have the same problem with sf2.8.

我为解决此问题所做的事情是:

What I did to solve this problem was:

首先:为实体生成表单. php app/console原则:generate:form NameBundle:EntityName

first: generate the form for the entity. php app/console doctrine:generate:form NameBundle:EntityName

第二:为实体生成CRUD php应用程序/控制台原则:generate:crud

Second: generate the CRUD for Entity php app/console doctrine:generate:crud

这篇关于Symfony3:生成粗体不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆