瀏覽代碼

controller call

tags/0.1.0
Robin Thoni 9 年之前
父節點
當前提交
ff0d4f87dd
共有 1 個檔案被更改,包括 5 行新增3 行删除
  1. 5
    3
      src/Utils/LuRoute.php

+ 5
- 3
src/Utils/LuRoute.php 查看文件

@@ -92,9 +92,11 @@ class LuRoute {
92 92
                 }
93 93
             }
94 94
 
95
-            return LuOutputFormatter::formatSuccess(forward_static_call_array(array($controller, $method), $args));
96
-        },
97
-            'middleware' => $middleware_string];
95
+            $controllerInstance = new $controller();
96
+            $result = call_user_func_array(array($controllerInstance, $method), $args);
97
+
98
+            return LuOutputFormatter::formatSuccess($result);
99
+        }, 'middleware' => $middleware_string];
98 100
     }
99 101
 
100 102
     /**

Loading…
取消
儲存