If you've been around the Symfony
community for some time so I think you have used the SensioGeneratorBundle. It's a popular bundle that provides console
commands to generate boilerplate code, like controllers and entities. It also
includes a basic CRUD generator.
Given that SensioGeneratorBundle is
starting to show its age and considering the massive simplifications introduced
by Symfony 4, they decided to stop evolving that
bundle and they've created a new bundle called SymfonyMakerBundle.
SymfonyMakerBundle helps you
creating empty commands, controllers, form classes, tests and more so you can
forget about the required boilerplate code. It's an alternative to
SensioGeneratorBundle for modern Symfony applications and requires using
Symfony 3.4 or newer and Symfony Flex.
Of course the end goal is to not
have boilerplate code at all in Symfony applications. Symfony 4 made a lot of
improvements towards that goal, but you will always have to bootstrap some
code, so having a modern, simple and lightweight bundle to do that is nice.
Generating Code with Makers
The usage of the bundle is similar
to SensioGeneratorBundle, but the commands now use the make: prefix instead of generate: In this bundle you can find few
commands as below:
php bin/console list make
make:command
make:controller
make:entity
make:form
make:functional-test
make:subscriber
make:twig-extension
make:unit-test
make:validator
make:voter
Comments
Post a Comment