2017 © Pedro Peláez
 

library slim-json

JSON middleware for Slim PHP framework

image

buagern/slim-json

JSON middleware for Slim PHP framework

  • Sunday, March 22, 2015
  • by buagern
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

SlimJson

Latest Version Software License Total Downloads, (*1)

This is an extension to the Slim Framework to implement JSON output., (*2)

Install

Via Composer, (*3)

``` bash $ composer require buagern/slim-json, (*4)


or adding this line to your composer.json file ``` bash "buagern/slim-json": "0.1.*"

Usage

To include the middleware and view you just have to load them using the default Slim way. Read more about Slim Here (https://github.com/codeguy/Slim#getting-started), (*5)

``` php require 'vendor/autoload.php';, (*6)

$app = new \Slim\Slim();, (*7)

$app->view(new \Buagern\SlimJson\View); $app->add(new \Buagern\SlimJson\Middleware);, (*8)


### Using Routing Middleware method ``` php function jsonResponse() { $app = \Slim\Slim::getInstance(); $app->view(new \Buagern\SlimJson\View); $app->add(new \Buagern\SlimJson\Middleware); } $app->get('/', function () use ($app) { // normal view render return $app->render('view.php'); }); $app->get('/json', 'jsonResponse', function () use ($app) { // this request will return json response return $app->render(200, [ 'message' => 'JSON response', ]); });

Security

If you discover any security related issues, please email buagern@buataitom.com instead of using the issue tracker., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

22/03 2015

dev-master

9999999-dev https://github.com/buagern/slim-json

JSON middleware for Slim PHP framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

middleware json slim view

22/03 2015

0.1.2

0.1.2.0 https://github.com/buagern/slim-json

JSON middleware for Slim PHP framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

middleware json slim view

02/03 2015

v0.1.1

0.1.1.0 https://github.com/buagern/slim-json

JSON middleware for Slim PHP framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

middleware json slim view

02/03 2015

0.1.1

0.1.1.0 https://github.com/buagern/slim-json

JSON middleware for Slim PHP framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

middleware json slim view