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

infinite-networks/form-bundle

Infinite Networks FormBundle is a Symfony bundle that adds reusable form types and helpers on top of Symfony Forms, reducing boilerplate when building, rendering, and handling forms. It integrates cleanly into existing Symfony applications and streamlines common form workflows.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with Composer (composer require infinite-networks/form-bundle, historically ~2.0 for Symfony 2.8/3.x; last tagged release was 2017-05-12) and register InfiniteNetworks\FormBundle\InfiniteFormBundle in AppKernel.php / config/bundles.php.
  • Read the bundle README first, then look at DependencyInjection/Configuration.php (the infinite_form tree) and Resources/config/*.xml/*.yml to see exactly which form types and FormTypeExtensions are pre-registered. Most day-to-day value comes from extensions, not from the types themselves — extensions apply silently to every matching form field.
  • Enable the Twig form theme shipped with the bundle if you want the corresponding markup/JS hooks:
    {% form_theme form 'InfiniteFormBundle::layout.html.twig' %}
    
    (Symfony 4+ path would be @InfiniteForm/layout.html.twig, but see Gotchas.)
  • First, most valuable use case: drop Infinite\FormBundle\Form\Type\ImageType into an entity form with a thumbnail + delete/reset UI:
    ->add('photo', ImageType::class, [
        'image_path' => 'getWebPath',   // or a property
        'image_size' => ['width' => 200],
        'allow_delete' => true,
    ])
    
    Second: enable a WYSIWYG on an existing TextareaType via the wysiwyg option, or add placeholder/help/autocomplete options to text fields without touching templates.

Implementation Patterns

  • Rely on extensions for cross-cutting UX. Once registered, PlaceholderExtension, AutocompleteExtension, LengthExtension, HelpExtension, WysiwygExtension, Select2Extension, ChosenExtension, SortableExtension, TabExtension, and RecaptchaExtension attach to their target types. Set the option ('placeholder' => '...', 'help' => '...', 'wysiwyg' => 'ckeditor', 'autocomplete' => false, 'length' => ['min' => 5]) on the field — no custom widget needed.
  • WYSIWYG on existing forms. Keep using TextareaType and set 'wysiwyg' => 'tinymce' or 'ckeditor'; toggle the default in infinite_form config if most textareas should be rich editors. Prefer a named toolbar option per field when forms mix rich and plain text.
  • Image/File handling. Use ImageType (single image with preview, allow_delete, show_reset_button) and FileType (multi-file / dropzone) instead of hand-rolled FileType + Twig. Provide a path via a getter/setter on the entity (image_path, image_setter-style options) so the widget can render previews and honor delete checkboxes on submit. Combine with Symfony's standard delete/mapped => false mapping if you want a clean service class rather than an entity.
  • Autocomplete. Back AutoCompleteType with a JSON route ('route' => 'app_user_search', 'entity' => User::class, 'property' => 'name', plus a 'search' callable/repository method for custom queries). Return [{id, text}, ...]; the field stores the selected id as a normal EntityType-style value, so validation and Doctrine mapping behave normally.
  • Sortable collections. Use the bundle's CollectionType with 'sortable' => true; the JS records data-sortable on each row. In the controller, reorder the submitted collection (by _sort / data-sortable index) before persisting, and use by_reference => false plus a setter so the reordered array is assigned back to the entity.
  • Tabbed forms. TabExtension lets you group fields via the tab option and render with the bundle's tab helper/theme. Prefer this over hand-writing tab markup when you already use the bundle's theme, so field errors surface in the correct tab.
  • Recaptcha. Register RecaptchaType and configure site/secret keys under infinite_form (component flags also control whether the reCAPTCHA <script> is emitted by the layout template). Validation runs via the bundle's constraint — disable the key or use a fake in functional tests.

Gotchas and Tips

  • Era lock-in. Last release is 2017; it targets Symfony 2.8/3.x and jQuery-era front-end plugins (jQuery UI, Select2, Chosen, bootstrap-datetimepicker, CKEditor/TinyMCE 4, dropzone). Expect friction on Symfony 4+/5+/6+: bundle notation Twig paths, getName() on types, form.type_extension tag format, and deprecated DependencyInjection APIs all need patching or a fork.
  • Extensions apply globally. Registering the bundle means placeholder/help/length/autocomplete attributes can appear on forms you didn't intend. Override per field ('placeholder' => false/null, 'autocomplete' => false) or restrict the extension by config; use bin/console debug:form AppBundle\Form\FooType (Symfony 3+) to see which extensions and options are actually applied.
  • Assets are not bundled for you. The components config flags only influence whether the shipped layout.html.twig emits <script>/<link> tags for jQuery, jQuery UI, Select2, Chosen, Bootstrap, datetimepicker, CKEditor, TinyMCE, Dropzone, Sortable, reCAPTCHA. You still must ship those vendor files (or point the tags at CDNs). With Webpack Encore/Vite, set the component flags off and include the assets yourself to avoid duplicate/conflicting jQuery.
  • Form theme coupling. ImageType/FileType/tab/sortable widgets expect the bundle's Twig theme; using the default Symfony theme produces broken markup or missing handles. If you only need one widget, extend the bundle theme in a local theme instead of pulling in the whole layout.
  • Collection sorting is JS-driven. The data-sortable order is only meaningful if your submit handler reads it — the bundle doesn't reorder entities for you. Also guard against by_reference (Doctrine may keep the original collection order) and add a missing-_sort fallback for clients with JS disabled.
  • File/image delete semantics. Deleting via allow_delete returns a checkbox in the request, not a nulled field; make sure the entity setter/nullable mapping handles the delete case, and clear the physical file in a preFlush/postRemove listener — the bundle won't.
  • Debugging widgets. If an option seems ignored, confirm the field type matches the extension's getExtendedType() (e.g., LengthExtension targets TextType, not TextareaType) and check that infinite_form config from your app overrides the bundle defaults (bundle defaults may silently win if the extension key isn't set).
  • Extension point for your own needs. Rather than fork, add your own FormTypeExtensionInterface services tagged form.type_extension for anything custom; the bundle's own extensions are good reference implementations, and you can subclass its types (e.g., ImageType) to change defaults.
  • Long-term plan. Given the 2017 release, unmaintained status, and zero dependent packages, treat it as a reference implementation: extract the specific behaviors you want (image preview, drag-sort collections, WYSIWYG wiring) into small, modern Symfony form types/extensions rather than adopting the whole bundle on a greenfield Symfony 4+ project.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect