After releasing Symfony 4.0, there is no support for SensioGeneratorBundle
. hence the command php app/console generate:doctrine:crud
is not available.
They suggest to use MakerBundle, but I could not find appropriate replacement for CRUD generation.
Could anyone help?
You can use the make
command in Symfony4+ (and it's quite an improvement!), from the MakerBundle:
php bin/console make:crud
It'll prompt you for which entity you want the crud for. It generates a controller with index, new, update, view and delete methods in /src/controller
, with matching templates in /templates
.
Useful to know: If you run make:entity
, and later run that command again and enter an existing entity, it responds with:
Your entity already exists! So let's add some new fields!
At the moment MakerBundle
supports just a few core commands. You can see the list here. Unfortunately there's no CRUD generator. But there some discussion about it in the issues so you can follow what will be done.
If what you need is just a generator for boilerplate code and not a more structured solution like EasyAdminBundle you should consider creating your own maker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With