2017 © Pedro Peláez
 

library silex-jsend

Silex JSend Component

image

junker/silex-jsend

Silex JSend Component

  • Sunday, June 5, 2016
  • by Junker
  • Repository
  • 1 Watchers
  • 1 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

SilexJsend

JSend Component for Silex, (*1)

Requirements

silex 1.x, 2.x, (*2)

Installation

The best way to install SilexJsend is to use a Composer:, (*3)

php composer.phar require junker/silex-jsend

Examples


class Application extends \Silex\Application { use \Junker\Silex\Application\JSendTrait; }

use \Junker\Symfony\JSendResponse; $app->get('/', function() use ($app) { $data = ['id' => 50, 'name' => 'Waldemar']; $message = 'Error, total error!'; $code = 5; return $app->jsend(JSendResponse::STATUS_SUCCESS, $data); #or return $app->jsend(JSendResponse::STATUS_FAIL, $data); #or return $app->jsend(JSendResponse::STATUS_ERROR, NULL, $message); #or return $app->jsend(JSendResponse::STATUS_ERROR, $data, $message, $code); #or return $app->jsendSuccess($data); #or return $app->jsendFail($data); #or return $app->jsendError($message); #or return $app->jsendError($message, $code, $data); });

Documentation

http://silex.sensiolabs.org/doc/master/usage.html#traits, (*4)

The Versions

05/06 2016

dev-master

9999999-dev

Silex JSend Component

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex response jsend

05/06 2016

0.2.0

0.2.0.0

Silex JSend Component

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex response jsend

04/06 2016

0.1.2

0.1.2.0

Silex JSend Component

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex response jsend

03/06 2016

0.1.1

0.1.1.0

Silex JSend Component

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex response jsend

03/06 2016

0.1

0.1.0.0

Silex JSend Component

  Sources   Download

MIT

The Requires

 

by Dmitry Kosenkov

silex response jsend