@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | if (!empty($path)) { |
40 | 40 | $tmpAction=array_pop($path); |
41 | - $tmpArray=explode(".",$tmpAction); |
|
41 | + $tmpArray=explode(".", $tmpAction); |
|
42 | 42 | self::$ext=$tmpArray[1]??""; |
43 | 43 | $tmpAction=preg_replace('/\.(html|aspx|do|php|htm|h5|api|json|xml)$/i', '', $tmpAction); |
44 | 44 | $tmpAction=parse_name($tmpAction, 1); |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | $response=$res; |
108 | 108 | $renderType=self::$ext; |
109 | 109 | |
110 | - if($renderType=='json'){ |
|
110 | + if ($renderType == 'json') { |
|
111 | 111 | $response=json($res); |
112 | - }elseif ($renderType=='xml'){ |
|
112 | + }elseif ($renderType == 'xml') { |
|
113 | 113 | //todo:: 支持xml格式化输出 |
114 | 114 | $response='don\'t support xml now!'; |
115 | - }elseif ($renderType==""){ |
|
116 | - if(is_array($res)||is_object($res)){ |
|
115 | + }elseif ($renderType == "") { |
|
116 | + if (is_array($res) || is_object($res)) { |
|
117 | 117 | $response=json($res); |
118 | 118 | } |
119 | 119 | } |
@@ -109,10 +109,10 @@ |
||
109 | 109 | |
110 | 110 | if($renderType=='json'){ |
111 | 111 | $response=json($res); |
112 | - }elseif ($renderType=='xml'){ |
|
112 | + } elseif ($renderType=='xml'){ |
|
113 | 113 | //todo:: 支持xml格式化输出 |
114 | 114 | $response='don\'t support xml now!'; |
115 | - }elseif ($renderType==""){ |
|
115 | + } elseif ($renderType==""){ |
|
116 | 116 | if(is_array($res)||is_object($res)){ |
117 | 117 | $response=json($res); |
118 | 118 | } |