PHPackages                             kolyya/photo-bundle - 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. kolyya/photo-bundle

ActiveSymfony-bundle

kolyya/photo-bundle
===================

Allows you to upload an unlimited number of photos for the object, delete them and sort them. Also allows you to specify several formats for storing photos.

038PHP

Since Feb 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kolyya/photo-bundle)[ Packagist](https://packagist.org/packages/kolyya/photo-bundle)[ RSS](/packages/kolyya-photo-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Kolyya Photo Bundle
===================

[](#kolyya-photo-bundle)

Allows you to upload an unlimited number of photos for the object, delete them and sort them. Also allows you to specify several formats for storing photos.

Requires
--------

[](#requires)

- [intervention/image: &gt;=2.3](https://packagist.org/packages/intervention/image)
- [Dropzone Js](http://www.dropzonejs.com/)
- [jQuery UI](https://jqueryui.com/)

Installation
------------

[](#installation)

1. Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

    ```
    $ composer require kolyya/photo-bundle
    ```
2. Enable bundle in your `AppKernel.php`

    ```
    // AppKernel.php
    public function registerBundles()
       {
           $bundles = [
           // ...
           new Kolyya\PhotoBundle\KolyyaPhotoBundle(),
           // ...
           ];
       //...
    ```
3. Define routes

    ```
    # app/config/routing.yml
    kolyya_photo:
        resource: "@KolyyaPhotoBundle/Resources/config/routing.yml"
    ```
4. 4.1 Create an entity(ies) for photos, inheriting from `Kolyya\PhotoBundle\Entity\Photo`.

    4.2 Set methods `getObject()` and `setObject()`
5. Add [object(s)](#object) in [Config](#Config) `config.yml`

    ```
    kolyya_photo:
         objects:
             product:
              object_class: AppBundle\Entity\Product
              photo_class: AppBundle\Entity\ProductPhoto
              check_permissions: app.check_permissions
              path: images/product
              manager_format: small
              formats:
                  small:
                      resize: [120,120]
                  medium:
                      heighten: 250
                  full:
                      resize: false
                      heighten: false

             ...
    ```

Usage
-----

[](#usage)

1. On the page where the photo editor form will be include [Dropzone Js](http://www.dropzonejs.com/) and [jQuery UI](https://jqueryui.com/)

    ```
    {# Dropzone Js #}

    {# Jquery Ui #}

    ```
2. Include a handler template with parameters `objectId`, `objectName`, `photos`

    ```
    {{ kolyya_photo_manager(, , ) }}
    ```

Config
------

[](#config)

### Object

[](#object)

- **object\_class** - Object Entity for which photos are added;
- **photo\_class** - Photo Entity;
- **check\_permissions** - *optional* - \[Service\](#Check Permissions) to verify the rights to actions with this object;
- **path** - Path, relative to the web directory for storing photos;
- **manager\_format** - Format of Photo, to show in handler;
- **formats** - List of [formats](#format) to store photos.

### Format

[](#format)

*The format name is the folder name for this format*

- **resize** | boolean/array | optional | Fit in a specific format (default: false)
- **heighten** | boolean/integer | optional | Fit to width (default: false)

### Check Permissions

[](#check-permissions)

When you need to check the permissions, one of the methods works: `canUpload()`, `canDelete()` or `canSort()`.

- **$object** - Product Object
- **$photo** - Photo Object

```
    public function canUpload($object)
    {
        return true;
    }

    public function canDelete($photo)
    {
        return true;
    }

    public function canSort($object)
    {
        return true;
    }
```

This example allows everyone to do anything.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c424468b9642c806ad822b2e1f2ddbf6bd601b659aa6ea55db3ed625282a92d?d=identicon)[kolyya](/maintainers/kolyya)

---

Top Contributors

[![kolyya](https://avatars.githubusercontent.com/u/8344044?v=4)](https://github.com/kolyya "kolyya (3 commits)")

### Embed Badge

![Health badge](/badges/kolyya-photo-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kolyya-photo-bundle/health.svg)](https://phpackages.com/packages/kolyya-photo-bundle)
```

PHPackages © 2026

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