remg/generator-bundle
REMG Generator Bundle is a Symfony package that speeds up backend development through code generation. It helps scaffold repetitive application code from your existing models, reducing boilerplate and letting teams focus on custom business logic.
Treat remg/generator-bundle as a legacy Symfony 3 scaffolding tool, not an actively maintained dependency. It is archived, has very low adoption, and should only be introduced into an existing Symfony 3.x application where the cost of replacing it is higher than pinning it.
Minimal setup:
composer.json for PHP and Symfony constraints. Install it only in a Symfony 3.4-era application and pin an exact version:
composer require --dev remg/generator-bundle:<exact-version>
app/AppKernel.php, preferably only in the dev environment:
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Remg\GeneratorBundle\RemgGeneratorBundle();
}
bin/console list | grep -i remg
bin/console help <command-name>
Command/ — available generator commands and optionsResources/doc/ — any bundled documentationResources/skeleton/ — the templates that produce generated codeDependencyInjection/Configuration.php — configurable optionsDo not expect a modern Flex recipe, Symfony 4+ support, or PHP 8 compatibility. The first practical step is often deciding whether the generated output is worth the integration cost versus using Symfony's MakerBundle in a newer application.
The bundle is most useful as a one-shot scaffolder, not as an ongoing code-generation pipeline.
Generate once, then own the code. Generate into a clean working tree, review the diff, commit it, and treat the output as hand-written code afterward. Repeated regeneration tends to fight customizations.
Isolate generated code. Generate into a dedicated namespace such as AppBundle\Admin or a separate bundle. If you need customization, extend or wrap generated classes rather than editing them in place.
Override templates for project conventions. Copy templates from Resources/skeleton/ into the appropriate override location—typically app/Resources/RemgGeneratorBundle/...—and adjust base template inheritance, flash messages, route names, form themes, and controller conventions. This is the main extension point and is usually more maintainable than patching vendor code.
Use a repeatable wrapper workflow. If you generate more than once, wrap the command in a project script that:
Generate after Doctrine mapping is stable. Forms and CRUD templates depend heavily on entity metadata. Associations, nullable fields, embeddables, and custom column types are common sources of broken generated code.
Keep it out of production and CI runtime. Register the bundle only in dev/test. If you keep it long term, add a CI job that installs the exact pinned version on the supported PHP/Symfony combination so you notice environment breakage.
Plan the exit. For new development, use Symfony MakerBundle or hand-maintained stubs. If the legacy app must stay on Symfony 3, fork the bundle under your own vendor namespace, pin it, and document that the generation path is frozen.
Command/, Resources/skeleton/, and DependencyInjection/Configuration.php rather than relying on blog posts.bin/console cache:clear --env=dev
Also confirm the bundle is registered in the environment you are using.--force, --no-interaction, and dry-run-style options.src/AppBundle or kernel.root_dir. Override templates or configuration if your project layout differs, and watch for getProjectDir() versus kernel.root_dir differences.@Route syntax or deprecated service patterns. Check Symfony 3.4 deprecation logs after generating.base.html.twig. Copy and adapt templates instead of editing vendor files.var/cache and var/logs are writable by the web/CLI user. Run cache:clear after configuration changes.-vvv; inspect the generator command and skeleton templates; generated files are typically Twig-rendered strings, so template errors are the usual cause of malformed output.How can I help you explore Laravel packages today?