переход на статику
This commit is contained in:
1 parent
cbe21226dd
commit
480770064d
2 files changed
+5
-4
No files matched your search
+3
-2
@@ -27,12 +27,13 @@
|
||||
// TODO: дописать реализацию API
|
||||
// pre($USER);
|
||||
require_once __DIR__ . '/../inc/lib/CAPI.class.php';
|
||||
$API = new CAPI();
|
||||
|
||||
try {
|
||||
$API->$method();
|
||||
$result = CAPI::$method();
|
||||
} catch (Throwable $e) {
|
||||
echo CJson::create(['status' => 'fail', 'message' => 'Метод '.$method.' не найден']);
|
||||
die();
|
||||
}
|
||||
|
||||
echo CJson::create($result);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class CAPI {
|
||||
|
||||
function test(){
|
||||
echo 'test completed.';
|
||||
public static function test(){
|
||||
return ['status' => 'ok', 'message' => 'test was completed :)'];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user