ideationnet / action-dispatcher
Action dispatcher for PSR-15 compatible middleware
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/ideationnet/action-dispatcher
Requires
- php: ~7.0
- http-interop/http-middleware: ^0.3.0
- php-di/invoker: ^1.3
This package is not auto-updated.
Last update: 2022-02-01 13:03:46 UTC
README
A PSR-15 "Action Domain Responder" middleware that dispatches to actions resolved by Action Resolver.
Actions are dispatched using an Invoker, such as the one provided by PHP-DI.
Configuration
Actions should resolve to an instance of IdNet\Action
where
the input, domain, and responder have been set.
The dispatcher will use the provided implementation of
InvokerInterface
to invoke the callables.
'action.example' => object(Action::class) ->method('domain', YourDomainClass::class), 'input.default' => get(YourDefaultInput::class), 'responder.default' => get(YourDefaultResonder::class),] 'another.action' => object(Action::class) ->method('input', OverrideInputClass::class) ->method('domain', AnotherDomain::class) ->method('responder', CustomResponder::class),