Weave Code
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 Extension Bundle

Form Extension Bundle Laravel Package

armetiz/form-extension-bundle

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Form Extension Bundle
Can I use this bundle in Laravel (Symfony 5/6/7/8) or is it strictly for Symfony 2.x?
This bundle is hard-coded for Symfony 2.1–2.3 and won’t work in Laravel or newer Symfony versions without major refactoring. Laravel uses Symfony 5+ by default, so you’d need to replace it with native Symfony Form Component solutions or a custom AJAX form type. The `bind()` method (deprecated in Symfony 3+) is a critical blocker.
How do I replace the default 'entity' type with 'entity_ajax' in my Laravel/Symfony form?
Replace `EntityType` with `entity_ajax` in your form builder. For example, change `->add('owner', EntityType::class)` to `->add('owner', 'entity_ajax')`. All standard `EntityType` options (like `class`, `property`, or `query_builder`) still apply. Ensure you’ve enabled the bundle in `AppKernel.php` (Symfony 2.x) or `config/bundles.php` (Symfony 3+).
What frontend libraries does this bundle require, and can I use alternatives like Select2?
The bundle relies on **Chosen** for styling and **Ajax Chosen** for dynamic loading. While you *can* swap Chosen for Select2 or Bootstrap Typeahead, you’ll need to manually override the JavaScript logic since the bundle hardcodes Chosen dependencies. This requires custom JS or forking the bundle, which isn’t recommended due to its lack of maintenance.
Does this bundle work with Laravel’s Eloquent ORM, or is Doctrine ORM required?
This bundle **only works with Doctrine ORM** and assumes Symfony’s default entity repositories. Laravel’s Eloquent ORM won’t integrate directly, as the bundle uses Doctrine-specific features like `bind()` (deprecated in Symfony 3+) and XML response parsing. For Laravel, consider using native Symfony Form Component solutions or a custom AJAX form type with Eloquent.
How do I set up the AJAX endpoint to fetch lazy-loaded entities?
You must create a custom route (e.g., `/user/search`) that returns XML in the format `<item><id>...</id><username>...</username></item>`. The bundle doesn’t auto-generate this endpoint—you’ll need to build it manually, including CSRF protection, authentication, and rate limiting. Example: Use Symfony’s `FOSRestBundle` or a simple controller returning XML from a Doctrine query.
Is there a performance benefit over Symfony’s native `query_builder` for large datasets?
Yes, but with trade-offs. The bundle **reduces initial payload size** by lazy-loading entities via AJAX, which is ideal for large datasets (e.g., 10,000+ users). However, it adds **frontend JS overhead** and requires an extra HTTP request. For comparison, Symfony’s `query_builder` with `max_results` or `where()` clauses can also limit results server-side without AJAX, but it loads all data upfront.
How do I secure the AJAX endpoint against CSRF attacks or malicious XML responses?
The bundle doesn’t include built-in security for the AJAX endpoint—you must implement it manually. Use Symfony’s `CSRF token` protection (e.g., via `csrf_token()` in templates) and validate XML responses server-side. For Laravel, use middleware like `VerifyCsrfToken` or libraries like `spatie/array-to-xml` to sanitize responses. Always rate-limit the endpoint to prevent abuse.
Are there unit tests or integration tests for edge cases like empty results or malformed XML?
No, the bundle lacks tests entirely. Edge cases like empty AJAX responses or malformed XML could break client-side rendering. You’ll need to add custom validation in your frontend JS or backend logic. For critical projects, consider alternatives like Symfony’s `FormEvent` listeners or a custom form type with proper error handling.
What are the risks of using this abandoned package in production?
The bundle has **no stars, no dependents, and no recent updates**, indicating high abandonment risk. Symfony 3+ updates (e.g., `bind()` → `handleRequest()`) will break compatibility. Critical bugs or security flaws won’t be patched. For production, either fork the repo and maintain it yourself or replace it with a modern solution like Symfony’s `query_builder` + custom AJAX form type.
Can I customize the XML response format or switch to JSON for the AJAX endpoint?
No, the bundle **hardcodes XML responses** with a specific structure (`<item><id>...</id><username>...</username></item>`). Customizing it requires forking the bundle or overriding its JavaScript logic. For JSON, you’d need to replace the frontend library (Chosen/Ajax Chosen) and modify the backend endpoint to return JSON, which isn’t supported out of the box.
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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle