E-learning-Server/htdocs/api/v2/src/ApiTemplates.php
2014-11-17 23:04:39 +08:00

43 lines
1019 B
PHP

<?php
class ApiTemplates {
protected $app;
public function __construct($context) {
$this->app = $context;
}
public function inputParamErr($array = array()) {
$array += array(
'error' => true,
'msg' => '',
'msg_cht' => '缺少必要的參數',
'substatus' => 101
);
$this->app->render(400, $array);
}
public function inputContentTypeErr() {
$array = array(
'error' => true,
'msg' => '',
'msg_cht' => '輸入參數的Content-Type不在支援範圍內 或是沒有輸入',
'substatus' => 102
);
$this->app->render(400, $array);
}
public function noEnableFunc($array = array()) {
$array += array(
'error' => true,
'msg' => 'This function is not enable.',
'msg_cht' => '此功能尚未開放'
);
$this->app->render(405, $array);
}
}