Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kmvan/php-response
https://github.com/kmvan/php-response
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kmvan/php-response
- Owner: kmvan
- Created: 2022-04-24T11:24:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-04-24T11:24:32.000Z (over 2 years ago)
- Last Synced: 2024-03-03T08:34:32.375Z (10 months ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### INSTALL
```shell
composer require kmvan/response
```### REQUIRED
- PHP 8.1 or later
### USAGE
```php
setStatus(404)
->end(); // exit// 201 created
$res->setStatus(201)
->setData([ // output json
'name' => 'Jack',
])
->end(); // exit
```### RECOMMEND
Good experience with `composer require kmvan/status-code` library.
```php
setStatus(StatusCode::OK) // http status code 200
->end();
```