2017 © Pedro Peláez
 

library rapture-adr

Rapture ADR component

image

mrjulio/rapture-adr

Rapture ADR component

  • Saturday, November 18, 2017
  • by MrJulio
  • Repository
  • 0 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Rapture PHP ADR component

PhpVersion License, (*1)

Action-Domain-Responder pattern implementation, (*2)

More info here: https://github.com/pmjones/adr, (*3)

Requirements

  • PHP v7.0
  • php-json

Install

composer require mrjulio/rapture-adr

Quick start


# action namespace Demo\Action\User; class View extends Action { public function __invoke():array { $userId = $this->request()->getAttribute('id'); $user = \Demo\Domain\Model\UserQuery::create() ->filterById($userId) ->findOne(); if (!$user) { throw new HttpNotFoundException('User not found'); } return [ 'user' => $user ]; } } # Responder namespace Demo\Responder\User; class View extends Responder { // demo public function preInvoke(array $data) { $this->template = new Template($this->getTemplateName(), $data); } // demo public function __invoke(array $data) { $stream = new Stream(fopen('php://memory', 'r+')); $stream->write($this->template->render()); $this->response->withBody($stream)->send(); } } # Dispatcher (new Dispatcher('Demo', $router))->dispatch($request, $response);

About

Author

Iulian N. rapture@iuliann.ro, (*4)

Credits

  • https://github.com/pmjones/adr

License

Rapture PHP ADR is licensed under the MIT License - see the LICENSE file for details., (*5)

The Versions

18/11 2017

dev-master

9999999-dev http://rapture.iuliann.ro

Rapture ADR component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library

18/11 2017

v1.0.2

1.0.2.0 http://rapture.iuliann.ro

Rapture ADR component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library

25/08 2017

v1.0.1

1.0.1.0 http://rapture.iuliann.ro

Rapture ADR component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library

15/06 2017

v1.0

1.0.0.0 http://rapture.iuliann.ro

Rapture ADR component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library