Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mezcalito/ux-filemanager
Effortless file management with Symfony UX and Mezcalito UX FileManager
https://github.com/mezcalito/ux-filemanager
filemanager symfony symfony-bundle symfony-ux
Last synced: about 1 month ago
JSON representation
Effortless file management with Symfony UX and Mezcalito UX FileManager
- Host: GitHub
- URL: https://github.com/mezcalito/ux-filemanager
- Owner: Mezcalito
- License: mit
- Created: 2024-04-15T10:21:59.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T12:31:57.000Z (2 months ago)
- Last Synced: 2024-09-30T16:04:38.012Z (about 2 months ago)
- Topics: filemanager, symfony, symfony-bundle, symfony-ux
- Language: PHP
- Homepage:
- Size: 1020 KB
- Stars: 12
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Mezcalito UX FileManager
## 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](/doc/images/ux-filemanager-promo.png)
## Installation
Add [mezcalito/ux-filemanager](https://packagist.org/packages/mezcalito/ux-filemanager) to your composer.json file:
```bash
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:
```php
// config/bundles.phpreturn [
// ...
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:```yaml
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
| Name | Type | Required | Default value | Description |
|------------------|--------|----------|-----------------------------|-----------------------------------------------------------------------------------------------|
| path | string | Yes | | The path to the directory where files will be stored |
| media_url | string | No | domain from current request | The URL used to generate media links. If not set, the current domain will be used |
| ignore_dot_files | bool | No | true | If true, hidden files and directories (starting with a dot) will be ignored. Defaults to true |## 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
```twig
{{ component('Mezcalito:FileManager:FileSystem', { storage: 'local' }) }}
```### Using HTML-like Syntax
```twig```
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.