Skip to content

Interactive demo

This small, client-side simulation illustrates the path taken by the bundle: define a filter form, submit its rendered HTML fields, then let FilterBuilderUpdater add conditions to a Doctrine query builder.

It does not execute PHP or connect to a database. Its purpose is to make the relationship between the form, DQL and result set immediately visible. You can play the walkthrough or change the fields yourself.

THE FORM FILTER BUNDLE EFFECT

Two filters. One line of controller code.

Compare the boilerplate you maintain yourself with the work delegated to the bundle.
WITHOUT THE BUNDLE

Your controller grows for every field

// name filter
if ($name) {
$qb->andWhere(...);
$qb->setParameter(...);
}

// rank filter
if ($rank) {
$qb->andWhere(...);
$qb->setParameter(...);
}
Each filter means conditions, parameter names and repeated controller code.
VSsame form
WITH FORM FILTER BUNDLE

Your controller delegates the translation

$form->handleRequest($request);

$queryBuilder = $repository
->createQueryBuilder('p');

$filterBuilderUpdater
->addFilterConditions($form, $queryBuilder);
Use normal Symfony filter types. The bundle adds only active conditions and bound parameters.
1. The rendered Symfony form
2. The query work generated for you
SELECT p FROM Person p WHERE LOWER(p.name) LIKE LOWER(:name) AND p.rank >= :rankBound parameters: name = "%Ada%" · rank = 2
1 matching recordAda Lovelace Rank 3
The win: add a third filter to the form, not another block of controller query code.

The real bundle keeps the same division of responsibilities: Symfony handles form submission and validation; the bundle turns active filter fields into query conditions; Doctrine binds the parameters and runs the query.

Built and maintained by Spiriit — released under the MIT License.