PHPackages                             ggggino/sonataextrafields-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ggggino/sonataextrafields-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

ggggino/sonataextrafields-bundle
================================

This bundle contains some useful field types

1.0.4(6y ago)049MITHTMLPHP ^5.6|^7.0

Since Nov 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/GGGGino/SonataExtraFieldsBundle)[ Packagist](https://packagist.org/packages/ggggino/sonataextrafields-bundle)[ Docs](https://github.com/GGGGino)[ RSS](/packages/ggggino-sonataextrafields-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

SonataExtraFieldsBundle
=======================

[](#sonataextrafieldsbundle)

> A set of useful form fields for SonataAdmin

include the base theme

config.yml

```
twig:
    form_themes:
        ...
        - 'GGGGinoSonataExtraFieldsBundle:Form:extra_fields.html.twig'
```

routing.yml

```
ggggino_extrafields:
    resource: '@GGGGinoSonataExtraFieldsBundle/Controller/'
    type: annotation
```

### CollectionBuilder Field

[](#collectionbuilder-field)

With this class you can create collection items depending on a wizard(non mapped )

EntityAdmin.php

```
use Allyou\ManagementBundle\Form\Type\CustomCollectionType;

/**
 * @param FormMapper $formMapper
 */
protected function configureFormFields(FormMapper $formMapper)
{
    $formMapper
        ->add('medias', CollectionBuilderType::class, array(
                'by_reference' => false,
                'wrapper_class' => 'col-xs-4',
                'formWizard' => function(FormBuilderInterface $builder) {
                    // Here you can build your wizard
                },
                'formWizardPreSetData' => function(FormEvent $event) {
                    // Here you can set particular
                },
                'formWizardPreSubmit' => function(FormEvent $event) {
                    // Here you can manipulate the model before the persist
                },
                'formWizardOnSubmit' => function(FormEvent $event) {
                    // Here you can manipulate the model after the persist
                }
            ), array(
                'edit' => 'inline',
                //'inline' => 'table',
                'sortable' => 'position',
                'admin_code' => 'app.admin.media',
            ))
    ;
}
```

RealWorldExampleAdmin.php

```
$formMapper->add('fasce', CollectionBuilderType::class, array(
    'by_reference' => false,
    'wrapper_class' => 'col-xs-4',
    'formWizard' => function(FormBuilderInterface $builder) use ($em) {
        $companies = $em->getRepository(Company::class)->findAll();
        $companyMapped = array("Select a company" => 0);

        /** @var Ditta $value */
        foreach( $companies as $company ) {
            $companyMapped[$company->getLabel()] = $company->getId();
        }

        $builder
            ->add('company', ChoiceType::class, array(
                'choices' => $companyMapped
            ));
    },
    'formWizardOnSubmit' => function(FormEvent $event) use ($em) {
        $data = $event->getData();
        /** @var PersistentCollection $items */
        $items = $data['items'];
        $wizard = $data['wizard'];

        if( !isset($wizard['company']) || !$wizard['company'] )
            return;

        $idCompany = isset($wizard['company']) ? $wizard['company'] : null;
        $companyRef = $em->getReference(Company::class, $idCompany);

        /** @var User[] $usersInCompany */
        $usersInCompany = $em->getRepository(User::class)->findBy(array('company' => $companyRef));

        foreach($usersInCompany as $user) {
            $temp = new GiornataFascia();
            $temp->setOre(0);
            $temp->setUtente($user);

            $items->add($temp);
        }
    }
), array(
    'edit' => 'inline',
    'inline' => 'table',
    'sortable' => 'position',
    'admin_code' => 'app.admin.giornata_fascia',
));
```

> Extra options

*inherit all the extra property of the **PimpedCollection field***

NameTypeDefaultDescriptionformWizardfunctionnullClasse del campo es. per riconoscerloformWizardPreSetDatafunctionnullSe devo avere la conferma nella cancellazione direttaformWizardPreSubmitfunctionnullSe devo avere la conferma nella cancellazione direttaformWizardOnSubmitfunctionnullSe devo fare la cancellazione diretta### PimpedCollection Field

[](#pimpedcollection-field)

With this class you can add some useful property to the collection

EntityAdmin.php

```
use Allyou\ManagementBundle\Form\Type\CustomCollectionType;

/**
 * @param FormMapper $formMapper
 */
protected function configureFormFields(FormMapper $formMapper)
{
    $formMapper
        ->add('medias', CustomCollectionType::class, array(
                'by_reference' => false,
                'wrapper_class' => 'col-xs-4'
            ), array(
                'edit' => 'inline',
                //'inline' => 'table',
                'sortable' => 'position',
                'admin_code' => 'app.admin.media',
            ))
    ;
}
```

> Extra options

NameTypeDefaultDescriptionwrapper\_classstring''Class attr of the div container where you can put boostrap stylesfield\_classstring''Class attr of the inputdirect\_deletebooleanfalseIf you wnat to view the trash with an immediately effectdirect\_delete\_confirmbooleanfalseIf you want the confirm for the cancellationhideDefTabbooleanfalseIf you want to show the child tabs

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~49 days

Total

5

Last Release

2537d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71ba17da078527d84402fef98be186df83af523d0896e98907904efea4336b5d?d=identicon)[ggggino](/maintainers/ggggino)

---

Top Contributors

[![GGGGino](https://avatars.githubusercontent.com/u/3227441?v=4)](https://github.com/GGGGino "GGGGino (13 commits)")

---

Tags

symfonyfieldssonatasymfony4symfony3

### Embed Badge

![Health badge](/badges/ggggino-sonataextrafields-bundle/health.svg)

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

###  Alternatives

[aws/aws-sdk-php-symfony

A Symfony bundle for v3 of the AWS SDK for PHP

36517.7M22](/packages/aws-aws-sdk-php-symfony)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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