mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-07 05:57:30 +08:00
32 lines
867 B
PHP
Executable File
32 lines
867 B
PHP
Executable File
<?php
|
|
require_once APPPATH . '/libraries/api_controller.php';
|
|
|
|
use service\Network\Request;
|
|
use service\Network\Response;
|
|
use service\AccessControl\APIAuth;
|
|
|
|
class Base extends API_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->library('service');
|
|
}
|
|
|
|
public function _remap($method, $args)
|
|
{
|
|
// get controller name
|
|
$subcate = $this->uri->segment(3);
|
|
$method = strtolower(Request::parse()->method);
|
|
$controllerBaseName = $subcate ? $subcate : 'index';
|
|
$controllerName = $controllerBaseName . '_' . $method;
|
|
|
|
// check exsit and excute
|
|
if (method_exists($this, $controllerName)) {
|
|
return call_user_func_array(array($this, $controllerName), $args);
|
|
}
|
|
|
|
Response::reject(0x0105);
|
|
}
|
|
}
|