Initial commit
This commit is contained in:
commit
08a8a71c55
631 changed files with 139902 additions and 0 deletions
24
public/kirby/src/Panel/Request.php
Normal file
24
public/kirby/src/Panel/Request.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Panel;
|
||||
|
||||
use Kirby\Http\Response;
|
||||
|
||||
/**
|
||||
* @package Kirby Panel
|
||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license https://getkirby.com/license
|
||||
*/
|
||||
class Request
|
||||
{
|
||||
/**
|
||||
* Renders request responses
|
||||
*/
|
||||
public static function response($data, array $options = []): Response
|
||||
{
|
||||
$data = Json::responseData($data);
|
||||
return Panel::json($data, $data['code'] ?? 200);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue