Skip to content

About

PHP Simple Response, XML, JSON,... auto response with accept in request's header

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

simple-response

Software License Total Downloads

Simple package to handle response properly in your API. This package does not include any dependency.

Install

Via Composer

$ composer require phuongdanh/simple-response

Requirements

The following versions of PHP are supported by this version.

  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • PHP 7.2
  • PHP 8.x

How to use it?

// Use namespace 
use SimpleResponse\Response;

// response with default data type based on Accept value in request's header
return Response::default($your_data);

// response as application/json
return Response::json($your_data);

// response as text/xml
return Response::xml($your_data);

License

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

About

PHP Simple Response, XML, JSON,... auto response with accept in request's header

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages