mezcalito/ux-filemanager

Effortless file management with Symfony UX and Mezcalito UX FileManager

0.1.2 2024-09-06 21:34 UTC

This package is auto-updated.

Last update: 2024-09-09 12:32:00 UTC


README

Overview

The Mezcalito File Manager Bundle provides an easy-to-use file management system in your Symfony application using Twig Components and Live Components. It allows you to create and manage multiple storages, each with its unique configuration. Currently, the bundle supports only a local filesystem provider.

Effortless file management with Symfony UX and Mezcalito UX FileManager

Installation

Add mezcalito/ux-filemanager to your composer.json file:

composer require mezcalito/ux-filemanager

Register and configure the bundle

If you are using Symfony Flex, the following steps should be done automatically. Otherwise, follow the instructions.

Register the bundle

Inside config/bundles.php, add the following line:

// config/bundles.php

return [
    // ...
    Mezcalito\FileManagerBundle\MezcalitoFileManagerBundle::class => ['all' => true],
];

Configuration

To configure the bundle, add the following configuration to your config/packages/mezcalito_file_manager.yaml file. This example demonstrates how to set up a local storage:

mezcalito_file_manager:
    storages:
        local:
            uri_prefix: /media
            provider: local
            options:
                path: '%kernel.project_dir%/public/uploads/storages/local'
                media_url: 'https://media.yourdomain.com/'
                ignore_dot_files: true

Storage Configuration Options

Usage

Once the bundle is installed and configured, you can use the file manager in your Twig templates. Here's how to include it in your template:

Using Twig Syntax

{{ component('Mezcalito:FileManager:FileSystem', { storage: 'local' }) }}

Using HTML-like Syntax

<twig:Mezcalito:FileManager:FileSystem storage="local"/>

In both cases, replace local with the name of the storage you want to use.

Issues and feature requests

Please report issues and request features at https://github.com/mezcalito/ux-filemanager/issues.

License

This bundle is under the MIT license. For the whole copyright, see the LICENSE file distributed with this source code.