Skip to content

Commit

Permalink
Enhance list form filters documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alterphp committed Oct 24, 2018
1 parent f50f933 commit 02004ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class Animation
}
```

Define your filters under `list`.`form_filters` entity configuration. Automatic guesser set up a ChoiceType for filters mapped on boolean (NULL, true, false) and string class properties. ChoiceType for string properties requires either a `choices` label/value array in `type_options` of a `choices_static_callback` static callable that returns label/value choices list.

Define your filters under `list`.`form_filters` entity configuration

```yaml
easy_admin:
Expand All @@ -148,6 +147,13 @@ Let's see the result !

![Embedded list example](/doc/res/img/list-form-filters.png)

Guesser for list form filters are based on mapped entity property :
* _boolean_: guessed filter is a choice list (null, Yes, No)
* _string_: guessed filter is multiple choice list that requires either `choices` (value/label array) or `choices_static_callback` (static callback from entity class returning a value/label array) in `type_options`.
* _*-to-one-relation_: guessed filter is a multiple autocomplete of relation target entity.

Filters form's method is GET and submitted through `form_filter` parameter. It is transmitted to the referer used for post update/delete/create redirection AND for search !

### Filter list and search on request parameters

* EasyAdmin allows filtering list with `dql_filter` configuration entry. But this is not dynamic and must be configured as an apart list in `easy_admin` configuration.*
Expand Down

0 comments on commit 02004ab

Please sign in to comment.