2017 © Pedro Peláez
 

library slim3-json-parser

Parsing JSON response for REST API with CORS management

image

malfasih/slim3-json-parser

Parsing JSON response for REST API with CORS management

  • Monday, July 23, 2018
  • by malfasih
  • Repository
  • 0 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

slim3-json-parser

Parsing JSON response for Slim v3 REST API with CORS management - https://projects.alal.io, (*1)

Installation

Before we get started, please make sure that you have installed Slim 3 Framework. I was using slim-born from HavenShen for developing this module., (*2)

$ composer require malfasih/slim3-json-parser

or, (*3)

composer.json, (*4)

"require": {
    "malfasih/slim3-json-parser": "@dev"
}

Registering Component

<?php
require __DIR__ . '/../vendor/autoload.php';
$app = new \Slim\App();
$container = $app->getContainer();

$container['json'] = function($container) {
    return new \Malfasih\Slim\JsonParser();
};

Testing

Just with a single line of code, and it actually works., (*5)

<?php

public function getUserData($request, $response)
{
  return $this->json->print($response, true, 'OK');
}

The Versions

23/07 2018

dev-master

9999999-dev

Parsing JSON response for REST API with CORS management

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Muhammad Alfasih

04/07 2018

v0.0.1

0.0.1.0

Parsing JSON response for REST API with CORS management

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Muhammad Alfasih