PHPackages                             spiriitlabs/form-filter-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. [Database &amp; ORM](/categories/database)
4. /
5. spiriitlabs/form-filter-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

spiriitlabs/form-filter-bundle
==============================

This bundle aim to provide classes to build some form filters and then build a doctrine query from this form filter.

v12.1.0(4mo ago)36465.8k—4.1%16[5 PRs](https://github.com/SpiriitLabs/form-filter-bundle/pulls)6MITPHPPHP ^8.1CI passing

Since May 28Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/SpiriitLabs/form-filter-bundle)[ Packagist](https://packagist.org/packages/spiriitlabs/form-filter-bundle)[ Docs](https://github.com/SpiriitLabs/form-filter-bundle)[ RSS](/packages/spiriitlabs-form-filter-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (76)Used By (6)

SpiriitFormFilterBundle
=======================

[](#spiriitformfilterbundle)

The LexikFormFilterBundle, a historical bundle, is now renamed to SpiriitFormFilterBundle. The code remains unchanged; only the name and organization have changed on GitHub.

---

This Symfony bundle aims to provide classes to build some form types dedicated to filter an entity. Once you created your form type you will be able to update a doctrine query builder conditions from a form type.

[![PHP Version](https://camo.githubusercontent.com/4e0c29111b81a2554ac975b1e97c60da897799337a54ad177f3c475ddb47c5d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737069726969746c6162732f666f726d2d66696c7465722d62756e646c65)](https://packagist.org/packages/spiriitlabs/form-filter-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/07cff24d7747d558d70deee81671a9f6ad64ce1b81f59497c9d72516a9dba65d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f737069726969746c6162732f666f726d2d66696c7465722d62756e646c653f7374796c653d666c61742d737175617265266c6162656c3d446f776e6c6f6164732532304d6f6e74686c79)](https://camo.githubusercontent.com/07cff24d7747d558d70deee81671a9f6ad64ce1b81f59497c9d72516a9dba65d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f737069726969746c6162732f666f726d2d66696c7465722d62756e646c653f7374796c653d666c61742d737175617265266c6162656c3d446f776e6c6f6164732532304d6f6e74686c79)[![Latest Stable Version](https://camo.githubusercontent.com/e3c36f959eba71cb9a59092c362eb2e1c3b4420ece60140fb219ff578b728bba/68747470733a2f2f706f7365722e707567782e6f72672f737069726969746c6162732f666f726d2d66696c7465722d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/spiriitlabs/form-filter-bundle)[![CI Tests](https://github.com/SpiriitLabs/form-filter-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/SpiriitLabs/form-filter-bundle/actions/workflows/ci.yml)

The idea is:

1. Create a form type extending from `Symfony\Component\Form\AbstractType` as usual.
2. Add form fields by using provided filter types (e.g. use TextFilterType::class instead of a TextType::class type) (\*).
3. Then call a service to build the query from the form instance and execute your query to get your result :).

(\*): In fact you can use any type, but if you want to apply a filter by not using a XxxFilterType::class type you will have to create a custom listener class to apply the filter for this type.

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

[](#installation)

================

The bundle can be installed using Composer or the [Symfony binary](https://symfony.com/download):

```
composer require spiriitlabs/form-filter-bundle

```

Use it in two steps
-------------------

[](#use-it-in-two-steps)

### create a form

[](#create-a-form)

```
