Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Form Bundle Laravel Package

symfony2admingenerator/form-bundle

Symfony2AdminGenerator FormBundle provides reusable Symfony form types, extensions, and helpers for admin-generator scaffolding, making CRUD form creation and customization easier in Symfony applications.

View on GitHub
Deep Wiki
Context7

Getting Started

The first thing to internalize: this is a Symfony 2-era bundle, not a Laravel package. A Laravel developer's realistic entry point is not composer require + service provider registration — it's harvesting the Twig form themes and adapting them, or running Twig in Laravel via rcrowe/twigbridge and pointing the loader at the bundle's Resources/views.

Minimal path:

  1. composer require symfony2admingenerator/form-bundle (or clone it — it's MIT, and with 3 stars you should assume you may need to patch it).
  2. Open Resources/views/Form/ first. That directory is the whole product. The bundle adds Twig blocks on top of the standard form_div_layout.html.twig hierarchy, giving you separate hooks for structure (wrappers, labels, errors), CSS (class attributes), and JS (data attributes / init hooks). Read the block names before writing any markup — the block name is the API.
  3. Check composer.json for the Symfony/Twig version constraints. A 2026 release date on a Symfony 2-lineage bundle usually means a maintained fork — confirm which branch you're actually pulling and whether it targets Twig 1.x syntax ({% for %}-era conventions) or modern Twig.
  4. First use case: render a single form in Twig and extend the theme — {% form_theme form 'Form/form_div_layout.html.twig' %} (substitute the actual template name you find in Resources/views/Form/), then override exactly one block per concern to see the three layers fire independently.

If you're not on Twig, skip ahead to Implementation Patterns — the block taxonomy is portable to Blade components even if the templates aren't.

Implementation Patterns

Override blocks, never whole templates. The bundle's value proposition is that you subclass its theme and replace one block at a time. A typical app theme:

{% extends 'Form/form_div_layout.html.twig' %}

{% block form_row %}
    <div class="form-row">{{ block('form_label') }}{{ block('form_widget') }}{{ block('form_errors') }}</div>
{% endblock %}

Copying the file and editing it in place throws away upgrades and the CSS/JS separation you paid for.

Layer the themes deliberately. The order in form_themes (Symfony) or your Twig config matters: base layout → bundle theme → your theme. If a block override "doesn't work," it's almost always ordering — your theme loaded before the bundle's, so the bundle wins.

Use the structure/CSS/JS split as the seam between backend and frontend. Backend devs touch structure blocks; the CSS block emits class names your stylesheet targets; the JS block emits data-* attributes or init markers. This is the pattern you'd reproduce in Laravel as a x-form.row Blade component plus a small attribute bag, and it's worth copying even if you never install the bundle.

Consistent per-field overrides. For admin-style CRUD forms, define a block per field type (_my_app_text_widget, _my_app_choice_widget) and register them through the form type's getBlockPrefix() rather than branching on form.vars.name. Branching on field name inside form_row is the fastest way to an unmaintainable template.

In Laravel + TwigBridge: register the bundle's view path as a Twig namespace ('Form' => base_path('vendor/.../Resources/views/Form')), then use {% form_theme %} normally. You will not get the Symfony Form component's renderer this way — TwigBridge ships its own form rendering, so expect to test the CSS/JS blocks against your actual form view objects.

Integration tip: treat the emitted class/data attributes as the contract with your asset pipeline (Vite/Encore). The bundle gives you hooks; it does not manage assets, and it never will.

Gotchas and Tips

  • Silent block fallbacks. Twig renders the parent block when a name doesn't match. A typo'd block name produces no error and no output — verify with {% dump %} inside the block, or temporarily replace its body with a literal string.
  • Twig version drift. Symfony 2-era templates use syntax that modern Twig either deprecates or rejects ({% spaceless %}, string-concat quirks, trans domain assumptions). Run a twig:lint-equivalent before blaming the bundle.
  • Not a Laravel service provider. Even if a provider is added, the bundle's Symfony DI config (DependencyInjection/) won't boot. Don't fight it; use the templates only.
  • Zero dependents and 3 stars means no community answers. The templates and the tests are the documentation. Read the tests first — they encode the expected block output more precisely than any README.
  • Recent release date ≠ modern code. Check whether the 2026-02-24 release is a compatibility patch on a legacy branch. Pin the version once you've confirmed it lints.
  • Extension point that matters: a custom FormType with a getBlockPrefix() returning your custom prefix is the clean way to get a bespoke block without touching form_row for everything.
  • Debugging checklist, in order: theme load order → exact block name in Resources/views/Form/ → Twig version lint → form.vars shape (TwigBridge's differs from Symfony's) → whether the block is even reached by your renderer.
  • Forking is a legitimate strategy. MIT, three stars, zero dependents — vendoring the handful of templates you actually use into resources/views/ is lower risk than depending on it, and it forces you to read the code you're relying on.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core