增加控制器扩展

This commit is contained in:
thinkphp
2015-12-10 23:58:03 +08:00
parent b2c0c61cd2
commit 3440c28552
7 changed files with 226 additions and 70 deletions

View File

@@ -23,7 +23,7 @@ abstract class rest
protected $restDefaultMethod = 'get';
protected $restTypeList = 'html|xml|json|rss';
protected $restDefaultType = 'html';
protected $restOutputType = [// REST允许输出的资源类型列表
protected $restOutputType = [ // REST允许输出的资源类型列表
'xml' => 'application/xml',
'json' => 'application/json',
'html' => 'text/html',
@@ -78,7 +78,7 @@ abstract class rest
$this->$fun();
} else {
// 抛出异常
throw new \think\Exception(\think\Lang::get('_ERROR_ACTION_:') . ACTION_NAME);
throw new \Exception('error action :' . ACTION_NAME);
}
}