Skip to content

kmvan/php-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

INSTALL

composer require kmvan/response

REQUIRED

  • PHP 8.1 or later

USAGE

<?php

use Kmvan\Response;

$res = new Response();

// 404 not found
$res->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

use Kmvan\StatusCode;
use Kmvan\Response;

$req = new Response();
$req->setStatus(StatusCode::OK) // http status code 200
    ->end();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages