xylemical / controller
Provides framework for controller-based execution.
dev-master
2022-06-30 05:46 UTC
Requires
- php: >7.4
- psr/http-message: >=1.0
- xylemical/account: dev-master
Requires (Dev)
- xylemical/composer-dev-bundle: ^0.1.1
This package is auto-updated.
Last update: 2025-03-29 00:53:20 UTC
README
Provides a framework for http server controller responses.
Install
The recommended way to install this library is through composer.
composer require xylemical/controller
Usage
<?php use Xylemical\Controller\Controller; use Xylemical\Controller\ContextFactory; $requester = ...; // class based on Xylemical\Controller\RequesterInterface $responder = ...; // class based on Xylemical\Controller\ResponderInterface $processor = ...; // class based on Xylemical\Controller\ProcessorInterface $factory = new ContextFactory(); $controller = new Controller($requester, $responder, $processor, $factory); // Both $request and $response are Psr-4 compatible interfaces. $response = $controller->handle($response);
License
MIT, see LICENSE.