PHPackages                             solenegk/artgris-media - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. solenegk/artgris-media

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

solenegk/artgris-media
======================

Fork de artgris/media-bundle

1.0.1(6mo ago)0891proprietaryPHPPHP 8.\*

Since Sep 18Pushed 5mo agoCompare

[ Source](https://github.com/SoleneGK/artgris-media)[ Packagist](https://packagist.org/packages/solenegk/artgris-media)[ Docs](https://github.com/SoleneGK/artgris-media)[ RSS](/packages/solenegk-artgris-media/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Umanit/MediaBundle - Easier Symfony Media Management
----------------------------------------------------

[](#umanitmediabundle---easier-symfony-media-management)

This repository is a fork of [artgris/MediaBundle](https://github.com/artgris/MediaBundle). It has not been tested out of the project is has been created for. The documentation below is a copy of the original one.

### Prerequisites

[](#prerequisites)

- symfony &gt;= 5.4
- [artgris/FileManagerBundle](https://github.com/artgris/FileManagerBundle#add-following-configuration-)
- Assets:
    - CSS: [bootstrap 4 or 5](http://getbootstrap.com/) and [Font Awesome](http://fontawesome.io/)
    - JS: [jQuery](https://jquery.com/), [ninsuo/symfony-collection](https://github.com/ninsuo/symfony-collection) and [jQuery UI](https://jqueryui.com/)

[![demo-gif](https://github.com/artgris/MediaBundle/raw/master/demo.gif)](https://github.com/artgris/MediaBundle/raw/master/demo.gif)

### Getting Started

[](#getting-started)

- Download the files:

    ```
      composer require artgris/media-bundle

    ```
- In `AppKernel.php` add the bundle:

    ```
      new Artgris\Bundle\MediaBundle\ArtgrisMediaBundle()

    ```
- Then, run the following command:

    ```
      php bin/console assets:install

    ```
- In your twig template, you will then need to import the required assets:

    - CSS (**requires [bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fontawesome.io/)**):

```
        {# Bootstrap 4 #}

        {# or Bootstrap 5 #}

        {# Font Awesome #}

        {# Artgris FileManager #}

        {# Import fengyuanchen/cropper #}

        {# Then the default bundle's CSS #}

```

- JS (**requires [jQuery](https://jquery.com/), [ninsuo/symfony-collection](https://github.com/ninsuo/symfony-collection) and [jQuery UI](https://jqueryui.com/)**):

```
    {# jQuery #}

    {# Bootstrap 4 #}

    {# or Bootstrap 5 #}

    {# Jqueri UI #}

    {# jquery.collection.js #}

    {# Import fengyuanchen/cropper #}

    {# Then the default bundle's JavaScript: #}
    {% include '@ArtgrisMedia/assets/include_js.html.twig' %}
```

- In `routing.yml`, you will need to import the Ajax route:

```
 artgris_media:
     resource: "@ArtgrisMediaBundle/Resources/config/routing.yml"
     prefix: /admin
```

### Usage

[](#usage)

In an entity, add the path attributes as string. You can also use doctrine's types such as `simple_array`, `array`, `json` for collections.

```
use Artgris\Bundle\MediaBundle\Form\Validator\Constraint as MediaAssert; // optionnal, to force image files

// ...

/**
 * @var string
 * @ORM\Column(type="string")
 * @Assert\NotNull()
 */
private $image;

/**
 * @var Collection|string[]
 * @ORM\Column(type="simple_array", nullable=true)
 * @MediaAssert\Image()
 */
private $gallery;
```

Then, use a form builder and assigne the `MediaType` class for a single file, or the `MediaCollectionType` for multiple files.

```
use Artgris\Bundle\MediaBundle\Form\Type\MediaType;
use Artgris\Bundle\MediaBundle\Form\Type\MediaCollectionType;

// ...

$builder
    ->add('image', MediaType::class, [
        'conf' => 'default'
    ])
    ->add('gallery', MediaCollectionType::class, [
        'conf' => 'default'
    ]);
```

### Options:

[](#options)

**MediaType:**

- `'conf' => 'yourconf'` (**required**) specifies a configuration defined in the FileManager. For more informations about media configurations, [refer to FileManagerBundle's documentation](https://github.com/artgris/FileManagerBundle#add-following-configuration-)
- `'extra' => []` (only with FileManagerBundle Service Configuration) [Extra Url parameters injections](https://github.com/artgris/FileManagerBundle/blob/master/Resources/doc/book/2-service-configuration.md#extra-url-parameters-injections)
- `'readonly' => false` prevents the user from manually changing the path (it only adds a "readonly" attribute to the corresponding HTML input)
- `'allow_crop' => true` allows the user to edit the image using [fengyuanchen/cropper](https://github.com/fengyuanchen/cropper)
- `'crop_options' => array` if `allow_crop` is set to `true`, allows to specify extra crop options. The default options:

```
'crop_options' => [
    'display_crop_data' => true,    // will display crop box informations (x, y, width, height, and ratio if there is one)
    'allow_flip' => true,           // allows to flip the image vertically and horizontally
    'allow_rotation' => true,       // allows to rotate the image (90 degrees)
    'ratio' => false                // force a crop ratio. E.g 16/9
],
```

**MediaCollectionType:**

- `'conf' => 'yourconf'` (**required**) specifies a configuration defined in the FileManager. For more informations about media configurations, [refer to FileManagerBundle's documentation](https://github.com/artgris/FileManagerBundle#add-following-configuration-)

Some [ninsuo/symfony-collection](https://github.com/ninsuo/symfony-collection)'s options are available directly:

- `'min' => 0`
- `'max' => 100`
- `'init_with_n_elements' => 1`
- `'add_at_the_end' => true`

Like regular collections, you can edit entries options, i.e to enable alts:

```
'entry_options' => [
    'display_file_manager' => false
]
```

### Changing cropping path

[](#changing-cropping-path)

add config/packages/artgris\_media.yaml

```
artgris_media:
    cropped_path: "cropped/" #default value

```

### Demo Application

[](#demo-application)

[MediaBundleDemo](https://github.com/artgris/MediaBundleDemo) is a complete Symfony application created to showcase MediaBundle features.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance68

Regular maintenance activity

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

2

Last Release

202d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33484a12b25e5d47ecf11e40ed748f9a711c27f2c3e1fa0e6bbf19b905e1f8c5?d=identicon)[SoleneGK](/maintainers/SoleneGK)

---

Top Contributors

[![artgris](https://avatars.githubusercontent.com/u/22889596?v=4)](https://github.com/artgris "artgris (73 commits)")[![Arkounay](https://avatars.githubusercontent.com/u/9340719?v=4)](https://github.com/Arkounay "Arkounay (27 commits)")[![Solene-Garda-Krebs](https://avatars.githubusercontent.com/u/100767045?v=4)](https://github.com/Solene-Garda-Krebs "Solene-Garda-Krebs (5 commits)")[![linkrb](https://avatars.githubusercontent.com/u/900590?v=4)](https://github.com/linkrb "linkrb (1 commits)")[![nedvajz](https://avatars.githubusercontent.com/u/1135477?v=4)](https://github.com/nedvajz "nedvajz (1 commits)")[![viniciusgpoliveira](https://avatars.githubusercontent.com/u/13926090?v=4)](https://github.com/viniciusgpoliveira "viniciusgpoliveira (1 commits)")

---

Tags

symfonybundledoctrinemediaform

### Embed Badge

![Health badge](/badges/solenegk-artgris-media/health.svg)

```
[![Health](https://phpackages.com/badges/solenegk-artgris-media/health.svg)](https://phpackages.com/packages/solenegk-artgris-media)
```

###  Alternatives

[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[spiriitlabs/form-filter-bundle

This bundle aim to provide classes to build some form filters and then build a doctrine query from this form filter.

36465.8k8](/packages/spiriitlabs-form-filter-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)[huluti/doctrine-relations-analyser

A Symfony bundle that provides tools for analyzing Doctrine relationships

145.3k](/packages/huluti-doctrine-relations-analyser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
