PHPackages                             bitsystem/searchpro - 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. [Search &amp; Filtering](/categories/search)
4. /
5. bitsystem/searchpro

ActiveLibrary[Search &amp; Filtering](/categories/search)

bitsystem/searchpro
===================

Este es una libreria que te permite listar las tablas de una base de datos. Pueden mostrar tablas relacionadas y filtrarlas entre multiples valores. Pagina los resultados y puedes asignar el numero de resultados por pagina

1.0.0(7y ago)2119MITPHP

Since Jul 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/juliangarciaga3/SearchPro)[ Packagist](https://packagist.org/packages/bitsystem/searchpro)[ RSS](/packages/bitsystem-searchpro/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Image
=====

[](#image)

Libreria adaptada para symfony **3.x**, **4.x**Recorta imagenes que se obtienen desde los ficheros temporales(/tmp) del servidor.En esta carpeta se suele guardar los datos pasados por formularios, etc. Recorta las miniaturas de la imagen centrada segun los parametros que se le pase y retorna un array con la ruta donde se guardaron y genera minuaturas. Estas imagenes son guardadas en una carpeta alojada en "/web" o "/public".

Índice
------

[](#índice)

- [¿Como funciona?](#how-work-image)

[SearchGloom](/src/searchGloom.md)

¿Como funciona?
---------------

[](#como-funciona)

- Primero: Obtienes la ruta donde se encuentra la imagen temporal.
- Segundo: Instancia la clase **Imagen()**
- Tercero: Inserta el nombre de la imagen con el metodo setName()
- Cuardo: Inserta la imagen temporal, el nombre de la carpeta donde se guarda y el callBack donde llamar las funciones de Thumbnail
- Quinto: **save()** retorna un array con los datos meta de la imagen guardada.

Llama la libreria

```
use Bitsystem\Backend\Image;
```

```
//Obtiene la imagen pasada por un formulario
$imageBinary = $request->files->get('image', FALSE);

//Instancia la clase
$image = new Image();
$image->setName($request->request->get('name', NULL));
$image->insertImage($imageBinary, 'course',function($e){
    $e->thumbnail(40,40);
    $e->thumbnail(364,205);
    $e->thumbnail(1080,720);
});

//Retorna un array
$imageSave = $image->save();

//Recorre el array para obtener el path de la imagen
foreach ($imageSave['thumbnails'] as $value){
    $value['route'];
    $value['width'];
    $value['height'];
}
```

Search Pro
==========

[](#search-pro)

Search pro es una libreria pensada para mostrar las tablas de una base de datos nombrando la tabla y las columnas que necesitamos visualizar. Ademas puedes filtrar las tablas por las columnas. Incluye un sistema de paginacion que busca los resultados de la tabla por Ajax segun los filtros seleccionados.

Índice
------

[](#índice-1)

- [¿Como funciona?](#how-work)
    - [Twig](#twig)
    - [Php](#php)
- [Parametros](#params)
    - [Paginacion](#paging)
    - [Info](#info)
    - [setTable](#table)([string](http://php.net/manual/es/language.types.string.php))
    - [addFilter](#add-filter)([array](http://php.net/manual/es/language.types.array.php))
    - [addColum](#add-colum)([array](http://php.net/manual/es/language.types.array.php))
    - [addColumForeignKey](#colum-foreign-key)([array](http://php.net/manual/es/language.types.array.php))
    - [selectRow](#select-row)([array](http://php.net/manual/es/language.types.array.php))
    - [search](#search)([string, string](http://php.net/manual/es/language.types.string.php))
    - [getResult()](#result)
- [Estructura de Tablas](#params)

¿Como funciona?
---------------

[](#como-funciona-1)

Accedemos a la terminal y instalamos con composer la libreria en el composer.json de nuestro proyecto Symfony

```
composer require bitsystem/searchpro

```

### Twig

[](#twig)

Necesitamos agregar primero el select2.js necesario para poder visualizar los filtros de la tabla. Despues tableList.js al final.

```
{{ blocks javascripts }}
    //Dependencias

    //Plugin para generar la tabla

{{ endblocks }}
```

Php
---

[](#php)

Primero incluimos la libreria en el controlador.

```
use Bitsystem\SearchPro\Search as Search;
```

Recogemos el texto a buscar y el filtro a buscar. Instancion la clase y usas los metodos que necesites para mostrar las columnas.

```
//Campo de busqueda
$textSearch = $request->request->get('q','');

//Parametros del filtro
$filter = $request->request->get('filter','');
$search = new Search($this->getDoctrine()->getManager(), $request);
$result = $search->setTable('Clientes')
    ->addColum([
                'id' => 'id',
                'nombre' => 'nombre'
    ])
    ->selectRow([	1 => 1,
                    10 => [ 10, true ],
                    20 => 20,
                    30 => 30,
                    40 => 40,
                    'Todo' => 'all'
                ])
    ->search('nombre',$textSearch)
    ->getResult();
    return $result;
```

Parametros
----------

[](#parametros)

### Paginación

[](#paginación)

Si necesitamos ocultar la paginacion de la tabla solo tenemos que añadir la opcion paging. Por defecto el valor de paging es `TRUE`

```
paging: false

```

### Numero de resultados

[](#numero-de-resultados)

El numero de resultados totales de columnas de la tabla se muestra debajo de la paginacion. Por defecto el valor de info es `TRUE`Si necesitamos ocultar la informacion solo tenemos que añadir la opcion info.

```
info: false

```

### addColum

[](#addcolum)

```
->addColum([
            'nombre variable' => 'Nombre columna Tabla'
])
```

Metodo encargado de obtener el nombre de la tabla principal para poder hacer las consultas. La tabla principal se relaciona con otras tablas con los metodos [addColumForeignKey()](#colum-foreign-key) , [addColumForeignKey()](#colum-foreign-key)

```
->setTable('Nombre tabla')
```

```
->addColumForeignKey([
          'POPULATION' => [
                          'type' => 'select',
                          'table' => 'MUNICIPALITY',
                          'columReference' => 'MUNICIPALITY',
                          'colum' => 'POPULATION'
                      ]
     ])
```

Para implementarlo necesitamos insertar en nuestro controlador y en la vista twig algunos archivos necesarios.

Estructura basica html

```

                    Buscar:

                    Buscar

```

```
$("#search-pro").search({
    textSend: $('#find'),
    buttonSend: $('#find-ajax'),
    paging: false,
    info: false,
    colums: ['Id','Nombre'],
    tableRow: function(data){
        var row = "";
        $.each(data.result, function(k, v){
            row += "\
                        "+v.id+"\
                            \
                            "+v.nombre+"\
                        \
                    ";
        });
        return row;
    }
});
```

`npm install`

#### NOTA

[](#nota)

Esta librera utiliza los metodos GET y POST debemos asegurarnos de que tenemos habilitada la request de ellas

### Resultado

[](#resultado)

Vista de como se ve la tabla segun los parametros indicados

[![tabla](https://user-images.githubusercontent.com/24224731/43127144-08474f72-8f2f-11e8-8feb-4f778e01f2b0.JPG)](https://user-images.githubusercontent.com/24224731/43127144-08474f72-8f2f-11e8-8feb-4f778e01f2b0.JPG)

```
Give the example

```

And repeat

```
until finished

```

End with an example of getting some data out of the system or using it for a little demo

Running the tests
-----------------

[](#running-the-tests)

Explain how to run the automated tests for this system

### Break down into end to end tests

[](#break-down-into-end-to-end-tests)

Explain what these tests test and why

```
Give an example

```

### And coding style tests

[](#and-coding-style-tests)

Explain what these tests test and why

```
Give an example

```

Deployment
----------

[](#deployment)

Add additional notes about how to deploy this on a live system

Built With
----------

[](#built-with)

- [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
- [Maven](https://maven.apache.org/) - Dependency Management
- [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds

Contributing
------------

[](#contributing)

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).

Autor
-----

[](#autor)

- **Julian Garcia Garcia** - *Creador* - [Juliangarciaga3](https://github.com/juliangarciaga3)

Consulte también la lista de [colaboradores](https://github.com/juliangarciaga3/SearchPro/graphs/contributors) que participaron en este proyect.

Licencia
--------

[](#licencia)

Este proyecto está licenciado bajo la Licencia MIT - ver el [LICENSE.md](LICENSE.md) archivo para detalles

Inspirado
---------

[](#inspirado)

- [Datatables](https://datatables.net/)
- [Bootstrap 3.3.7](https://getbootstrap.com/)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

Unknown

Total

1

Last Release

2890d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67a260cd259e651adf98b028aa1b65aa64eaeb4d3e4aad8a268a09595c7cdafa?d=identicon)[juliangarciaga3](/maintainers/juliangarciaga3)

---

Top Contributors

[![juliangarciaga3](https://avatars.githubusercontent.com/u/24224731?v=4)](https://github.com/juliangarciaga3 "juliangarciaga3 (49 commits)")

### Embed Badge

![Health badge](/badges/bitsystem-searchpro/health.svg)

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

###  Alternatives

[ircmaxell/filterus

A library for filtering variables in PHP

44613.4k6](/packages/ircmaxell-filterus)[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26190.2k](/packages/awesome-nova-dependent-filter)

PHPackages © 2026

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