ideationnet/action-dispatcher

This package is abandoned and no longer maintained. The author suggests using the ideationnet/invoker-router-middleware package instead.

Action dispatcher for PSR-15 compatible middleware

1.1.0 2016-12-14 18:07 UTC

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),