PHPackages                             kunicmarko/sonata-importer-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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. kunicmarko/sonata-importer-bundle

AbandonedArchivedSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

kunicmarko/sonata-importer-bundle
=================================

Easier handling of Import in Sonata Admin.

0.1.3(5y ago)29.7k↓86.7%3MITPHPPHP ^7.4

Since Jul 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kunicmarko20/SonataImporterBundle)[ Packagist](https://packagist.org/packages/kunicmarko/sonata-importer-bundle)[ Docs](https://github.com/kunicmarko20/SonataImporterBundle)[ RSS](/packages/kunicmarko-sonata-importer-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (12)Versions (8)Used By (0)

SonataImporterBundle
====================

[](#sonataimporterbundle)

Easier handling of Import in Sonata Admin.

Built on top of [Importer](https://github.com/kunicmarko20/importer).

[![PHP Version](https://camo.githubusercontent.com/2dcf2757d7a2ae7d144c6e7d9b63bd3383509e6b70bacccb3bd8ad04d1c2541c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e312d626c75652e737667)](https://img.shields.io/badge/php-%5E7.1-blue.svg)[![Latest Stable Version](https://camo.githubusercontent.com/15d4aa47b7b35b48095eab27b3220d0e1b7aafcfaa5950274956883c511ee563/68747470733a2f2f706f7365722e707567782e6f72672f6b756e69636d61726b6f2f736f6e6174612d696d706f727465722d62756e646c652f762f737461626c65)](https://packagist.org/packages/kunicmarko/sonata-importer-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/7620b854de708e5189cb913f84059e9c22cb3cb6bf99a44d7138252439a4e193/68747470733a2f2f706f7365722e707567782e6f72672f6b756e69636d61726b6f2f736f6e6174612d696d706f727465722d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/kunicmarko/sonata-importer-bundle)

[![Build Status](https://camo.githubusercontent.com/472b39dc6d73d367c12b432535c74dbc128d437ac9829d01a9734f7b4cb21003/68747470733a2f2f7472617669732d63692e6f72672f6b756e69636d61726b6f32302f536f6e617461496d706f7274657242756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kunicmarko20/SonataImporterBundle)[![Coverage Status](https://camo.githubusercontent.com/ec6c87b88b3054f9d7a1a6ef8e96ce0ac172bd5a18163597239e7ff7939ff819/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6b756e69636d61726b6f32302f536f6e617461496d706f7274657242756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/kunicmarko20/SonataImporterBundle?branch=master)

[![Import Action](docs/images/import_action.png)](docs/images/import_action.png)

[![Import Form](docs/images/import_form.png)](docs/images/import_form.png)

Documentation
-------------

[](#documentation)

- [Installation](#installation)
- [Configuration](#configuration)
- [How to use](#how-to-use)
    - [Prepare Admin Class](#prepare-admin-class)
    - [Prepare Controller](#prepare-controller)
        - [Custom Controler](#custom-controller)
    - [Autoconfigure ImportConfiguration](#autoconfigure-importconfiguration)

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

[](#installation)

Because Symfony Flex auto-detects and then registers bundles on its own, you first need to install `kunicmarko/importer`, add it to `bundles.php`, and then do the same thing for `kunicmarko/sonata-importer-bundle`.

**1.** Install kunicmarko/importer

First you need to install `kunicmarko/importer`, and register the bundle by following [this](https://github.com/kunicmarko20/importer#installation) guide.

**2.** Add dependency with composer

```
composer require kunicmarko/sonata-importer-bundle
```

**3.** Register the bundle in your Kernel

```
return [
    //...
    KunicMarko\SonataImporterBundle\SonataImporterBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Currently, you can only change the template files used in bundle, default config looks like:

```
# config/packages/sonata_importer.yaml
sonata_importer:
    templates:
        form:                 '@SonataImporter/form.html.twig'
        action_button:        '@SonataImporter/action_button.html.twig'
        dashboard_action:     '@SonataImporter/dashboard_action.html.twig'
```

How to use
----------

[](#how-to-use)

If you haven't already go and read [Importer documentation](https://github.com/kunicmarko20/importer#how-to-use). I will assume you are already familiar with ImportConfiguration and I will just explain what is different in this bundle.

### Prepare Admin Class

[](#prepare-admin-class)

Your Admin class has to implement `KunicMarko\SonataImporterBundle\Admin\AdminWithImport`.

### Prepare Controller

[](#prepare-controller)

By default if you don't set Controller in your Admin service definition we will replace it with instance of `KunicMarko\SonataImporterBundle\Controller\ImportCRUDController`.

#### Custom Controller

[](#custom-controller)

If you are using your own custom controller make sure it implements `KunicMarko\SonataImporterBundle\Controller\ControllerWithImport`, also you will have to add `KunicMarko\SonataImporterBundle\Controller\ImportActionTrait`trait to your controller.

### AutoConfigure ImportConfiguration

[](#autoconfigure-importconfiguration)

To be able to auto-configure your ImportConfiguration they will have to implement `KunicMarko\SonataImporterBundle\SonataImportConfiguration` and configure `format` and `adminClass` methods along with other methods.

That will look like:

```
class CategoryCSVImportConfiguration implements SonataImportConfiguration
{
    /**
     * @var EntityManagerInterface
     */
    private $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    public static function adminClass(): string
    {
        return CategoryAdmin::class;
    }

    public static function format(): string
    {
        return 'csv';
    }

    public function map(array $item, array $additionalData)
    {
        $category = new Category();

        $category->setName($item[0]);

        $this->entityManager->persist($category);
    }

    public function save(array $items, array $additionalData): void
    {
        $this->entityManager->flush();
    }
}
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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 ~269 days

Total

4

Last Release

2084d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.1.3PHP ^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13528674?v=4)[Marko Kunic](/maintainers/kunicmarko20)[@kunicmarko20](https://github.com/kunicmarko20)

---

Top Contributors

[![kunicmarko20](https://avatars.githubusercontent.com/u/13528674?v=4)](https://github.com/kunicmarko20 "kunicmarko20 (12 commits)")[![vstanchev](https://avatars.githubusercontent.com/u/9103789?v=4)](https://github.com/vstanchev "vstanchev (1 commits)")

---

Tags

hacktoberfestimportphpsonata-adminsymfonyjsonsymfonyxmlexcelcsvimportersonata

### Embed Badge

![Health badge](/badges/kunicmarko-sonata-importer-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kunicmarko-sonata-importer-bundle/health.svg)](https://phpackages.com/packages/kunicmarko-sonata-importer-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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