Skip to content

Commit 2542363

Browse files
committed
Action类的魔术方法中对操作方法的判断改进 支持C('ACTION_SUFFIX') 后缀设置
1 parent 79db327 commit 2542363

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ThinkPHP/Lib/Core/Action.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function __get($name) {
158158
* @return mixed
159159
*/
160160
public function __call($method,$args) {
161-
if( 0 === strcasecmp($method,ACTION_NAME)) {
161+
if( 0 === strcasecmp($method,ACTION_NAME.C('ACTION_SUFFIX'))) {
162162
if(method_exists($this,'_empty')) {
163163
// 如果定义了_empty操作 则调用
164164
$this->_empty($method,$args);
@@ -261,14 +261,14 @@ protected function success($message,$jumpUrl='',$ajax=false) {
261261
*/
262262
protected function ajaxReturn($data,$type='') {
263263
if(func_num_args()>2) {// 兼容3.0之前用法
264-
$args = func_get_args();
264+
$args = func_get_args();
265265
array_shift($args);
266-
$info = array();
266+
$info = array();
267267
$info['data'] = $data;
268268
$info['info'] = array_shift($args);
269269
$info['status'] = array_shift($args);
270-
$data = $info;
271-
$type = $args?array_shift($args):'';
270+
$data = $info;
271+
$type = $args?array_shift($args):'';
272272
}
273273
if(empty($type)) $type = C('DEFAULT_AJAX_RETURN');
274274
if(strtoupper($type)=='JSON') {

0 commit comments

Comments
 (0)