polysource / filter
Polysource — standalone filter primitive: form/datasource separation, session persistence, mapper/formatter/renderer pipeline, multi-mode UI (integrated, subpanel) with chips bar.
Package info
Type:symfony-bundle
pkg:composer/polysource/filter
v0.1.1
2026-05-10 21:00 UTC
Requires
- php: >=8.1
- polysource/core: ^0.1
- symfony/config: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/event-dispatcher: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/form: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/http-foundation: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/http-kernel: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/translation: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0 || ^8.0
- twig/twig: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5
- symfony/browser-kit: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/dom-crawler: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/phpunit-bridge: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symfony/twig-bundle: ^5.4 || ^6.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2026-05-10 21:01:35 UTC
README
Filter primitives for Symfony admin UIs — usable standalone in any Symfony app, also the foundation of
polysource/easyadmin-filter-bridgeandpolysource/admin.
Part of the Polysource monorepo. MIT-licensed.
What it ships
FilterCollection+FilterCriterion— immutable value objects representing the active filter state, scoped by a stableid(typically the resource FQCN).FilterService— session-backed persistence (load / save / clear per resource).- Enhanced form types — date presets (this-week / last-30-days / etc.), range pickers, multi-select, between, in.
- Twig extension
filter_tags— renders the active-filters chips bar. - Saved views —
SavedViewVO +SavedViewService+ Doctrine + in-memory storage adapters + Symfony voter for scope-aware visibility (private / team / public). See ADR-019. SavedViewExtensionTwig extension — renders the dropdown.
Audience
Standalone usage targets:
- Sonata users wanting better filter UX
- API Platform back-offices
- Hand-rolled admin DIY
- Any Symfony app that builds filter forms manually
For EasyAdmin v5 hosts, install polysource/easyadmin-filter-bridge instead — it wraps this package with auto-discovery.
Install
composer require polysource/filter
Register the bundle in config/bundles.php:
return [ Polysource\Filter\PolysourceFilterBundle::class => ['all' => true], ];
Extend it
| Need | Implement |
|---|---|
| Persist saved views in Redis / Mongo / your HTTP service | SavedViewStorageInterface (5 methods) |
| Resolve which "team" a user belongs to (for shared views) | SavedViewTeamResolverInterface (1 method) |
| Format a chip your way ("3 statuses" instead of "paid, shipped, …") | ChipFormatterInterface (1 method, ADR-016) |
| Take over the URL → criteria → form pipeline | FilterMapperInterface / FilterFormatterInterface / FilterRendererInterface |
See the full extensibility map.