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

Fm Elfinder Bundle Laravel Package

startsevdenis/fm-elfinder-bundle

fm-elfinder-bundle integrates the elFinder file manager into Symfony applications, providing a browser-based interface to browse, upload, edit, and organize files and directories through configurable connectors and routes.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Symfony2-era fork of the long-standing helios-ag/fm-elfinder-bundle family. Before writing any code, confirm three things: the package's composer.json require block (PHP/Symfony versions), whether the bundle name registered in the container is still FMElFinderBundle, and whether it is actually resolvable from Packagist. With 0 stars and 0 dependents, expect it to be unpublished or a private fork — if composer require startsevdenis/fm-elfinder-bundle fails, add a vcs repository entry and pin an explicit commit/tag.

Minimal wiring:

composer require startsevdenis/fm-elfinder-bundle
// app/AppKernel.php
new FM\ElfinderBundle\FMElFinderBundle(),
# app/config/routing.yml
elfinder:
    resource: "@FMElFinderBundle/Resources/config/routing.yml"
# app/config/config.yml
fm_elfinder:
    instances:
        default:
            locale: %locale%
            editor: ckeditor
            connector:
                roots:
                    uploads:
                        path: "%kernel.root_dir%/../web/uploads"
                        url: /uploads

Where to look first, in this order:

  1. DependencyInjection/Configuration.php — this is the real API surface. Every YAML key you can use is defined there, and the README is almost certainly stale relative to it.
  2. Resources/config/routing.yml — tells you the route names (elfinder, elfinder.loader) and the controller/connector entry points.
  3. Resources/config/services.yml — exposes the extension points (fm_elfinder.connector, fm_elfinder.builder, the volume/loader services).
  4. Tests/app/config/ — if present, the most reliable copy-pasteable working configuration.

First use case: an admin-only "Files" page. Add the elfinder route behind your security.yml firewall, open /elfinder (or /elfinder?instance=default), and confirm you can list, upload, and delete inside the configured root. Only after that works should you attempt embedding it in a form or a WYSIWYG editor.

Implementation Patterns

One instance per context, not per user. Declare several instances (admin_files, user_media, shared) sharing a connector config, and pick one at render time. This keeps firewall rules and root paths explicit instead of branching inside a callback.

Per-user home directories. Use the volume's path with a callback/placeholder or a small custom volume service that resolves the current user inside configure(). Resolving via %kernel.root_dir% plus the user ID is the simplest thing that survives a cache clear; avoid getUser() calls in YAML-level expressions that are evaluated before the security token exists.

Embedding in a form field. Render the standalone page and let elFinder's client-side file/getFileCallback return the selected path into a hidden input on the parent form. The standard pattern is a small Twig template opening the elFinder iframe/modal with ?instance=..., plus a customData/handlers block. Do not try to make the bundle an actual Symfony form type — it isn't one.

WYSIWYG integration. The editor: ckeditor (or tinymce, ckeditor4, summernote) key makes the bundle emit the right JS glue. If your editor version is newer than what this fork knows about, set editor: false and wire the file browser button yourself calling elFinderBrowser() with your own file callback.

Service overrides instead of patches. Since upstream maintenance is doubtful, treat the bundle as a vendored dependency: subclass or decorate fm_elfinder.connector/fm_elfinder.builder in your own services.yml (or use a compiler pass) rather than editing vendor code. That way a composer update or a switch to the original helios-ag package is a one-line change.

Non-local storage. If your files live on S3/Flysystem, don't fight the local path/url volume. Either use the flysystem volume type if this fork ships it, or register a custom elFinder volume class (a thin wrapper over the Flysystem adapter) and reference it from roots.<name>.driver/class.

Static assets. Old bundles of this family expect elFinder's JS/CSS from sp/bower-bundle + Assetic or from a web/bundles/fmelfinder/ dump. Verify early with assets:install --symlink and check whether the loader template resolves elFinder.min.js; a blank file manager UI is almost always this.

Gotchas and Tips

  • Symfony 4/5+ compatibility is not assumed. AppKernel, %kernel.root_dir%, and possibly Resources/config/services.yml (non-services: syntax) are Symfony 2/3 idioms. On a modern kernel you'll need a hand-written services.yaml shim and a bundle extension registered via Bundle::getContainerExtension(); budget an afternoon before committing to the package.
  • The connector route is a file-write API. Anyone who reaches elfinder.loader can upload, rename, and delete within the configured roots. Put it behind ROLE_ADMIN/IS_AUTHENTICATED_FULLY, and if the CSRF/bind options in the connector config are unclear, add a listener that rejects non-X-Requested-With requests.
  • path must be writable by the PHP user and url must map to that same directory. Mismatched path/url produces the classic "files upload but thumbnails are broken" symptom, because elFinder writes to one place and advertises another. Use an absolute path and verify with is_writable() in bin/console/a quick script.
  • Empty volume list / "Unable to connect to backend". The connector returns JSON; open /elfinder/loader (or whatever routing.yml names it) directly in the browser and read the response body. PHP fatals inside elFinder surface as HTTP 500 with the JSON error hidden, so check var/logs/ too. Common causes: missing roots, wrong driver, or a root key that doesn't match the instance name referenced by the page.
  • Config caching. fm_elfinder config is compiled into the container. After editing YAML run cache:clear; after changing PHP callbacks/volume classes also clear the opcode cache, or you'll debug a change that isn't loaded.
  • Locale and encoding. Set locale explicitly; the bundle's default often falls back to en_US regardless of %locale%, and filenames with non-ASCII characters get mangled if the connector's encoding option isn't set.
  • No upstream support. With no stars, dependents, or issue history, treat every bug as your bug. Keep a patch file or a fork under your own namespace, and evaluate replacing it with helios-ag/fm-elfinder-bundle (or just the raw elFinder PHP connector + a thin Symfony controller) — for a project already on a supported Symfony version, the thin-controller route is usually less work than reviving this bundle.
  • Extension points to prefer: fm_elfinder.builder for page-level options (theme, toolbar, height), fm_elfinder.connector for volume/roots behaviour, and elFinder's own client-side handlers/commands for UI tweaks. Editing templates in Resources/views/ is the fastest path but the first thing to break on an update.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource