Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

tag the service so it can be used in the route condition, #99 #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/route.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ class BlogController extends Controller
}
}
```

Symfony 6.1+ can check for the feature in the condition
```php
/**
* @Route("/blog/{page}", condition="service('flagception.manager.feature_manager').isActive('feature_123')")
*/
public function listAction($page)
{
// ...
}
```

or via yml

```yml
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
services:
flagception.manager.feature_manager:
class: Flagception\Manager\FeatureManager
tags:
- { name: routing.condition_service }
arguments:
- '@flagception.activator.chain_activator'
- '@flagception.decorator.chain_decorator'
public: true

Flagception\Manager\FeatureManagerInterface: '@flagception.manager.feature_manager'

flagception.expression_language:
Expand Down