2017 © Pedro Peláez
 

library symfony-jsend-response

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

image

junker/symfony-jsend-response

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

  • Saturday, January 27, 2018
  • by Junker
  • Repository
  • 1 Watchers
  • 1 Stars
  • 933 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

JSendResponse

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Laravel etc.), (*1)

Installation

The best way to install JSendResponse is to use a Composer:, (*2)

php composer.phar require junker/symfony-jsend-response

Examples

use Junker\JsendResponse\JSendResponse;
use Junker\JsendResponse\JSendSuccessResponse;
use Junker\JsendResponse\JSendFailResponse;
use Junker\JsendResponse\JSendErrorResponse;


class AppController
{
    ...

    $data = ['id' => 50, 'name' => 'Waldemar'];
    $message = 'Error, total error!';
    $code = 5;

    return new JsendResponse(JSendResponse::STATUS_SUCCESS, $data);
    #or
    return new JsendResponse(JSendResponse::STATUS_FAIL, $data);
    #or 
    return new JsendResponse(JSendResponse::STATUS_ERROR, NULL, $message);
    #or
    return new JsendResponse(JSendResponse::STATUS_ERROR, $data, $message, $code);
    #or
    return new JsendSuccessResponse($data);
    #or
    return new JsendFailResponse($data);
    #or
    return new JsendErrorResponse($message);
    #or
    return new JsendErrorResponse($message, $code, $data);

}

The Versions

27/01 2018

dev-master

9999999-dev

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

  Sources   Download

MIT

by Dmitry Kosenkov

silex symfony response jsend

04/06 2016

0.1.2

0.1.2.0

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

  Sources   Download

MIT

by Dmitry Kosenkov

silex symfony response jsend

04/06 2016

0.1.1

0.1.1.0

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

  Sources   Download

MIT

by Dmitry Kosenkov

silex symfony response jsend

03/06 2016

0.1

0.1.0.0

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)

  Sources   Download

MIT

by Dmitry Kosenkov

silex symfony response jsend