Download the PHP package foa/responder-bundle without Composer
On this page you can find all versions of the php package foa/responder-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download foa/responder-bundle
More information about foa/responder-bundle
Files in foa/responder-bundle
Package responder-bundle
Short Description Responder for action domain responder(adr) pattern
License BSD-2-Clause
Informations about the package responder-bundle
FOA.Responder_Bundle
AbstractResponder of action domain responder by Paul M Jones.
Foreword
Installation
It is installable and autoloadable via composer as foa/responder-bundle.
Quality
This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.
Community
To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our Google Group, follow @auraphp on Twitter, or chat with us on #auraphp on Freenode.
Example usage
It is recommend you first go through the action domain responder paper and example code.
In this examples we are using few aura components, but foa/responder-bundle
is not specifically for Aura framework. You can integrate in any framework if you like the concept using its classes.
Consider you are having a blog application, which you can browse the posts. Let us see how it looks in ADR. You should pay special attention to responder only. Action and Service layer components may differ with what you are using.
Action
Responder
First instantiate your templating engine of choice. Eg usage with Aura.View. See other templating engines supported below.
Create your responder object
Rendering and Setting content to response
Calling __invoke
will render and set the content on the response object. Now you can either use Aura\Web\ResponseSender
to send the response, or get the headers from response object and set to your favourite library response.
Aura framework integration with Aura.Di
In your project config/Common.php
define method add the below lines.
Don't forget to change the
renderer
with the one you like.
Integrated templating engines
Responder bundle integrates below templating engines. Feel free to choose the one you love.
Integrating other templating engines
Yes, and we love tests!.