2017 © Pedro Peláez
 

library psr7-middleware-yaml-parser

PSR-7 middleware that parses Yaml files to ServerRequest attribute

image

ichhabrecht/psr7-middleware-yaml-parser

PSR-7 middleware that parses Yaml files to ServerRequest attribute

  • Thursday, May 5, 2016
  • by IchHabRecht
  • Repository
  • 1 Watchers
  • 0 Stars
  • 182 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Yaml parser middleware

PSR-7 middleware that parses Yaml files to ServerRequest attribute., (*1)

Latest Stable Version Build Status, (*2)

This middleware parses Yaml files or strings. The result is stored in an own ServerRequest attribute for further usage., (*3)

Installation

It's recommended that you use Composer to install the Yaml parser., (*4)

$ composer require ichhabrecht/psr7-middleware-yaml-parser

Usage

In Slim 3:, (*5)

$app->add(new \IchHabRecht\Psr7MiddlewareYamlParser\YamlParser(__DIR__ . '/settings.yml'));

$app->get('/', function ($request, $response, $args) {
    $settings = $request->getAttribute('yaml');

    return $response;
});

Change attribute name, (*6)

It is possible to adjust the ServerRequest attribute name to your own needs., (*7)

$app->add(new \IchHabRecht\Psr7MiddlewareYamlParser\YamlParser(__DIR__ . '/settings.yml', 'settings'));

$app->get('/', function ($request, $response, $args) {
    $settings = $request->getAttribute('settings');

    return $response;
});

The Versions

05/05 2016

dev-master

9999999-dev https://github.com/IchHabRecht/psr7-middleware-yaml-parser

PSR-7 middleware that parses Yaml files to ServerRequest attribute

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware psr-7 yaml

05/05 2016

1.1.0

1.1.0.0 https://github.com/IchHabRecht/psr7-middleware-yaml-parser

PSR-7 middleware that parses Yaml files to ServerRequest attribute

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware psr-7 yaml

05/05 2016

1.0.0

1.0.0.0 https://github.com/IchHabRecht/psr7-middleware-yaml-parser

PSR-7 Middleware that parses Yaml files to ServerRequest attribute

  Sources   Download

MIT

The Requires

 

middleware psr-7 yaml