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

ActiveSymfony-bundle

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 2mo 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 75% 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

3340d 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

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[jolicode/gif-exception-bundle

The GhostBuster of your exception page

20596.8k](/packages/jolicode-gif-exception-bundle)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29733.3k](/packages/sulu-skeleton)[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)

PHPackages © 2026

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