Developed with love by KnpLabs Hire us for your project!
211

LexikFormFilterBundle

by lexik

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

Overview

This Symfony2 bundle aims to provide classes to build a form filter and then build a doctrine query from this form filter.

Build Status
Project Status
Latest Stable Version
SensioLabsInsight

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 filter_text instead of text 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 filter_xxx type you will have to create a custom class to apply the filter for this type.

Documentation

The master branch is compatible with Symfony 2.3 or higher, if you are using Symfony 2.0.x use the symfony2.0 branch.

For installation and how to use the bundle refer to Resources/doc/index.md

Running the test suite

composer install
bin/phpunit
Copyright (C) 2011-2012 Lexik <dev@lexik.fr>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
lexik_form_filter:

# Defined the doctrine query builder method the bundle will use to add the entire filter condition.
where_method: ~

# Whether to do case insensitive LIKE comparisons.
force_case_insensitivity: ~
  • allow to disable filter condition on a field
    By cedric-g, 1 year ago
  • run tests with SF 2.6
    By cedric-g, 1 year ago
  • Merge pull request #140 from Rvanlaak/patch-1
    By cedric-g, 1 year ago
  • Added validation chapter to doc index
    By Rvanlaak, 1 year ago
  • Update README.md
    By Rvanlaak, 1 year ago
  • Added documentation about Validation on FilterForms
    By Rvanlaak, 1 year ago
  • Ensure array_merge has an array
    By Rvanlaak, 1 year ago
  • Merge pull request #138 from sroze/entity-id-attribute
    By cedric-g, 1 year ago
  • Allow entities with public `id` attribute
    By sroze, 2 years ago
  • changed namespace Filter/Extension/ to Filter/Form/
    By cedric-g, 2 years ago
  • Merge pull request #135 from Rvanlaak/documentation
    By cedric-g, 2 years ago
  • + links at the bottom of the page to next chapter
    By Rvanlaak, 2 years ago
  • cut documentation in multiple documents, and add links to index file
    By Rvanlaak, 2 years ago
  • updated requirements and doc
    By cedric-g, 2 years ago
  • don't format date/datetime when doctrine param type is defined
    By cedric-g, 2 years ago
  • fixed array parameter type
    By cedric-g, 2 years ago
  • Merge pull request #127 from Padam87/sf26
    By cedric-g, 2 years ago
  • Updated branch alias
    By Padam87, 2 years ago
  • Symfony 2.6 compatibility
    By Padam87, 2 years ago
  • added doc about the where_method bundle option
    By cedric-g, 2 years ago
  • added adapter class to hint method parameter
    By cedric-g, 2 years ago
  • added new config option to choose the query builder method used to add theentire filter condition
    By cedric-g, 2 years ago
  • Merge branch 'filter_and_or'
    By cedric-g, 2 years ago
  • also run test with sf2.5
    By cedric-g, 2 years ago
  • updated doc
    By cedric-g, 2 years ago
  • use parameter types
    By cedric-g, 2 years ago
  • fixed spelling error
    By cedric-g, 2 years ago
  • upated doc
    By cedric-g, 2 years ago
  • fixed doc
    By cedric-g, 2 years ago
  • added new upgrade file
    By cedric-g, 2 years ago