Skip to content

Commit

Permalink
update readme and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric G committed Mar 4, 2013
1 parent 9c01c14 commit 9dd339a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Overview

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

`master` (sf 2.1) [![Build Status](https://secure.travis-ci.org/lexik/LexikFormFilterBundle.png?branch=master)](http://travis-ci.org/lexik/LexikFormFilterBundle)

`symfony2.0` [![Build Status](https://secure.travis-ci.org/lexik/LexikFormFilterBundle.png?branch=symfony2.0)](http://travis-ci.org/lexik/LexikFormFilterBundle)
[![Build Status](https://travis-ci.org/lexik/LexikFormFilterBundle.png?branch=master)](https://travis-ci.org/lexik/LexikFormFilterBundle)

The idea is:

1. Create a form type extending from `Symfony\Component\Form\AbstractType` as usual
2. Add form fields by using filter types instead of form types (e.g. use `filter_text` instead of `text` type)
3. Then call a service to build the query from the form instance.
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
=============
Expand Down
40 changes: 19 additions & 21 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
Installation
============

Symfony 2.0
-----------

Update your `deps` and `deps.lock` files:

// deps
...
[LexikFormFilterBundle]
git=https://github.com/lexik/LexikFormFilterBundle.git
target=/bundles/Lexik/Bundle/FormFilterBundle

// deps.lock
...
LexikFormFilterBundle <commit>

Symfony 2.1
-----------

Add the bunde to your `composer.json` file:

```javascript
Expand All @@ -37,9 +19,6 @@ composer.phar update
composer.phar update lexik/form-filter-bundle # to only update the bundle
```

Symfony *
---------

Register the namespaces with the autoloader:

```php
Expand All @@ -62,6 +41,25 @@ Register the bundle with your kernel:
);
```

Provided filter types
=====================

The bundle provide the following form types:

* filter_boolean
* filter_checkbox
* filter_choice
* filter_date
* filter_date_range
* filter_entity
* filter_number
* filter_number_range
* filter_text

By default the `required` option is set to `false` for all filter_xxx types.
All filter_xxx types also have a `apply_filter` option. By default this options is set to `null` and take a closure or a string as value. By using this options you can change the way to apply the condition on the query builder.


Usage
=====

Expand Down

0 comments on commit 9dd339a

Please sign in to comment.