Skip to content

Commit 6ddacfe

Browse files
Bartheyrman22 patch 1 (#36)
1 parent 7aaaf5c commit 6ddacfe

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Resources/doc/working-with-the-bundle.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,6 @@ class LocaleFilterType extends AbstractType
498498
}
499499
```
500500

501-
Then defined the `LocaleFilterType` as a service and remember to add the `form.type` tag:
502-
503-
```xml
504-
<service id="something.type.filter_locale" class="Super\Namespace\Type\LocaleFilterType">
505-
<tag name="form.type" />
506-
</service>
507-
```
508-
509501
Now we can use the `LocaleFilterType` type, but no filter will be applied. To apply a filter we need to listen some event, so let's create a subscriber:
510502

511503
```php
@@ -523,10 +515,12 @@ class FilterSubscriber implements EventSubscriberInterface
523515
{
524516
return [
525517
// if a Doctrine\ORM\QueryBuilder is passed to the spiriit_form_filter.query_builder_updater service
526-
'spiriit_form_filter.apply.orm.filter_locale' => ['filterLocale'],
518+
// "locale_filter" is the block prefix of the LocaleFilterType
519+
'spiriit_form_filter.apply.orm.locale_filter' => ['filterLocale'],
527520

528521
// if a Doctrine\DBAL\Query\QueryBuilder is passed to the spiriit_form_filter.query_builder_updater service
529-
'spiriit_form_filter.apply.dbal.filter_locale' => ['filterLocale'],
522+
// "locale_filter" is the block prefix of the LocaleFilterType
523+
'spiriit_form_filter.apply.dbal.locale_filter' => ['filterLocale'],
530524
];
531525
}
532526

0 commit comments

Comments
 (0)