80 lines
1.5 KiB
YAML
80 lines
1.5 KiB
YAML
|
name: AsRoutingConditionService
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: AutoconfigureTag
|
||
|
type: class
|
||
|
source: Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag
|
||
|
properties: []
|
||
|
methods:
|
||
|
- name: __construct
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: alias
|
||
|
default: 'null'
|
||
|
- name: priority
|
||
|
default: '0'
|
||
|
comment: '# * Service tag to autoconfigure routing condition services.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * You can tag a service:
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * #[AsRoutingConditionService(''foo'')]
|
||
|
|
||
|
# * class SomeFooService
|
||
|
|
||
|
# * {
|
||
|
|
||
|
# * public function bar(): bool
|
||
|
|
||
|
# * {
|
||
|
|
||
|
# * // ...
|
||
|
|
||
|
# * }
|
||
|
|
||
|
# * }
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Then you can use the tagged service in the routing condition:
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * class PageController
|
||
|
|
||
|
# * {
|
||
|
|
||
|
# * #[Route(''/page'', condition: "service(''foo'').bar()")]
|
||
|
|
||
|
# * public function page(): Response
|
||
|
|
||
|
# * {
|
||
|
|
||
|
# * // ...
|
||
|
|
||
|
# * }
|
||
|
|
||
|
# * }
|
||
|
|
||
|
# */
|
||
|
|
||
|
# #[\Attribute(\Attribute::TARGET_CLASS)]
|
||
|
|
||
|
# class AsRoutingConditionService extends AutoconfigureTag
|
||
|
|
||
|
# {
|
||
|
|
||
|
# /**
|
||
|
|
||
|
# * @param string|null $alias The alias of the service to use it in routing
|
||
|
condition expressions
|
||
|
|
||
|
# * @param int $priority Defines a priority that allows the routing condition
|
||
|
service to override a service with the same alias'
|
||
|
traits:
|
||
|
- Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag
|
||
|
interfaces: []
|