PHPackages                             gonzakpo/comun - 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. gonzakpo/comun

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

gonzakpo/comun
==============

Comun Bundle ofrece soluciones a circunstancias comunes en el desarrollo con Symfony

v3.0.5(9y ago)21.2k1MITPHP

Since Aug 9Pushed 9y ago3 watchersCompare

[ Source](https://github.com/gonzaloalonsod/ComunBundle)[ Packagist](https://packagist.org/packages/gonzakpo/comun)[ Docs](https://github.com/gonzakpo/ComunBundle)[ RSS](/packages/gonzakpo-comun/feed)WikiDiscussions version30 Synced 4w ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

ComunBundle
===========

[](#comunbundle)

Comun Bundle ofrece soluciones a circunstancias comunes en el desarrollo con Symfony
------------------------------------------------------------------------------------

[](#comun-bundle-ofrece-soluciones-a-circunstancias-comunes-en-el-desarrollo-con-symfony)

### Composer:

[](#composer)

```
php composer.phar require gonzakpo/comun

```

### AppKernel:

[](#appkernel)

```
new Tecspro\Bundle\ComunBundle\TecsproComunBundle(),
```

Como usar los servicios del bundle?
-----------------------------------

[](#como-usar-los-servicios-del-bundle)

Cada servicio dentro del bundle tiene un .yml separado para usar el respectivo servicio. Solo hay que importar el .yml del servicio que se desea utilizar en el config.yml del sistema.

```
services:
    tecspro_comun.slugify:
        class: Tecspro\Bundle\ComunBundle\Services\Slugify
    tecspro_comun.helpers_object_relation:
        class: Tecspro\Bundle\ComunBundle\Services\HelpersObjectRelation
    tecspro_comun.comun_mailer:
        class: Tecspro\Bundle\ComunBundle\Services\ComunMailer
```

Entre ellos:
------------

[](#entre-ellos)

service\_helpers\_object\_relation: retorna la diferencia de elementos entre arreglos, y los elementos comunes entre 2 arreglos.

```
$helpersObjectRelation = $this->get('tecspro_comun.helpers_object_relation');

$originalEntities = $entity->getEntities()->getValues();
$form->handleRequest($request);
$newEntities = $entity->getEntities()->getValues();

$entitiesAdd = $helpersObjectRelation->getEntitiesToAdd($newEntities, $originalEntities);

$entitiesRemove = $helpersObjectRelation->getEntitiesToRemove($newEntities, $originalEntities);
```

service\_slugify: filtra en una cadena de caracteres los caracteres raros, como acentos o simbolos.

service\_mailer: servicio que utiliza el servicio mailer para enviar correo electronicos. Se le debe

```
$services_comunmailer = $this->get('tecspro_comun.comun_mailer');

$services_comunmailer->send_mailer($asunto, $remitente, $destinatarios, $mensaje);
```

Funciones JS:
-------------

[](#funciones-js)

### Controlar patron en un input formulario

[](#controlar-patron-en-un-input-formulario)

#### Incluir en la vista:

[](#incluir-en-la-vista)

```

```

#### Incluir en el type del formulario (estos ejemplos permiten solo numeros):

[](#incluir-en-el-type-del-formulario-estos-ejemplos-permiten-solo-numeros)

#### Opcion 1

[](#opcion-1)

```
->add('campo', null, array(
    'attr'  => array(
        ...
        'class' => 'mwsValidaPatron',
        'mwspatron' => '[0-9]',
    )
))
```

#### Opcion 2

[](#opcion-2)

```
->add('campo', null, array(
    'attr'  => array(
        ...
        'onkeypress' => 'return validaPatron(event, "[0-9]")',
    )
))
```

### Reemplazar caracter

[](#reemplazar-caracter)

#### Incluir en la vista:

[](#incluir-en-la-vista-1)

```

```

#### Incluir en el type del formulario (este ejemplo reemplaza . por ,):

[](#incluir-en-el-type-del-formulario-este-ejemplo-reemplaza--por-)

```
->add('campo', null, array(
    'attr'  => array(
        ...
        'class' => 'mwsReemplazaValor',
        'mwsreemplazar'    => '.',
        'mwsreemplazarpor' => ',',
    )
))
```

Author
------

[](#author)

Gonzalo Alonso -

### Collaborators

[](#collaborators)

Chino - [emmanuel\_cabral@hotmail.com](mailto:emmanuel_cabral@hotmail.com)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 77.4% 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 ~45 days

Recently: every ~57 days

Total

6

Last Release

3387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ab7da460db4f61d98fb4c414cfbd87ca6134fe03dd4bcc764ac19a8164918f6?d=identicon)[gonzaloalonsod](/maintainers/gonzaloalonsod)

---

Top Contributors

[![gonzaloalonsod](https://avatars.githubusercontent.com/u/1031176?v=4)](https://github.com/gonzaloalonsod "gonzaloalonsod (41 commits)")[![camuschino](https://avatars.githubusercontent.com/u/7494840?v=4)](https://github.com/camuschino "camuschino (11 commits)")[![maxshtefec](https://avatars.githubusercontent.com/u/6925933?v=4)](https://github.com/maxshtefec "maxshtefec (1 commits)")

---

Tags

symfonycomunsolucionescircunstancias

### Embed Badge

![Health badge](/badges/gonzakpo-comun/health.svg)

```
[![Health](https://phpackages.com/badges/gonzakpo-comun/health.svg)](https://phpackages.com/packages/gonzakpo-comun)
```

###  Alternatives

[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.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[jbtronics/settings-bundle

A symfony bundle to easily create typesafe, user-configurable settings for symfony applications

9558.8k3](/packages/jbtronics-settings-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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