2021-07-09 18:28:29 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Sakura\Controllers;
|
|
|
|
|
2021-07-14 10:04:54 +08:00
|
|
|
use Sakura\Lib\BaseClass;
|
|
|
|
|
2021-07-09 18:28:29 +08:00
|
|
|
/**
|
|
|
|
* The controller abstract base
|
|
|
|
* @since 1.0.0
|
|
|
|
* @license GPLv3
|
|
|
|
* @author mashirozx <moezhx@outlook.com>
|
|
|
|
*/
|
2021-07-14 10:04:54 +08:00
|
|
|
class BaseController extends BaseClass
|
2021-07-09 18:28:29 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The rest API request parameters
|
|
|
|
* @since 0.0.1
|
|
|
|
* @var WP_REST_Request
|
|
|
|
*/
|
|
|
|
protected $request;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response status code
|
|
|
|
* @since 0.0.1
|
|
|
|
* @var WP_REST_Request
|
|
|
|
*/
|
|
|
|
protected $code = 200;
|
|
|
|
|
|
|
|
protected function request_parser(\WP_REST_Request $request)
|
|
|
|
{
|
|
|
|
$this->request = $request;
|
|
|
|
}
|
|
|
|
}
|