New and improved generators for MakerBundle
Symfony Maker Bundle is the fastest way to generate the most common code you'll need in a Symfony app: commands, controllers, form classes, event subscribers, etc. This bundle was introduced in time for the Symfony 4 release and it's an alternative to SensioGeneratorBundle in modern Symfony apps.
During the past months we've been busy improving it and its latest 1.2.0 version includes two new interesting features.
Added a new
This new generator is similar to the well-known
command from SensioGeneratorBundle and it generates a basic CRUD interface
for the given Doctrine entity:
1 2 3 4 5 6 7 8 9 10 11 12
$ bin/console make:crud BlogPost created: src/Controller/BlogPostController.php created: src/Form/BlogPostType.php created: templates/blog_post/_delete_form.html.twig created: templates/blog_post/_form.html.twig created: templates/blog_post/index.html.twig created: templates/blog_post/show.html.twig created: templates/blog_post/new.html.twig created: templates/blog_post/edit.html.twig Success!
Although this generator is not (and it will never be) a full-featured admin generator, it can be useful to quickly bootstrap some feature in your projects.
make:form generator created the skeleton of a
Symfony Form class so you could quickly add the needed form fields. In the
new version, this generator is smarter and it can optionally generate a complete
form class based on a Doctrine entity, adding a form field for every property of
1 2 3 4 5 6 7 8 9 10 11
$ bin/console make:form The name of the form class (e.g. GentleElephantType): > BlogPostType Enter the class or entity name that the new form will be bound to (empty for none): > BlogPost created: src/Form/BlogPostType.php Success!
New and improved generators for MakerBundle symfony.com/blog/new-and-improved-generators-for-makerbundleTweet this
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.