Browse Source

default empty parameters array

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
72cbf85192
2 changed files with 5 additions and 7 deletions
  1. 3
    5
      src/Utils/LuController.php
  2. 2
    2
      src/Utils/LuDbo.php

+ 3
- 5
src/Utils/LuController.php View File

6
 
6
 
7
 class LuController extends BaseController
7
 class LuController extends BaseController
8
 {
8
 {
9
-    public static $parameters = null;
9
+    public static $parameters = array();
10
 
10
 
11
     function execute($businessClass, $businessMethod)
11
     function execute($businessClass, $businessMethod)
12
     {
12
     {
13
-        $params = app('request')->route()[2];
14
-        self::$parameters = array_merge($_GET, $_POST, $params);
15
-        $business = new $businessClass();
13
+        self::$parameters = array_merge($_GET, $_POST, app('request')->route()[2], self::$parameters);
16
 
14
 
17
         $reflect = new \ReflectionMethod($businessClass, $businessMethod);
15
         $reflect = new \ReflectionMethod($businessClass, $businessMethod);
18
         $params = $reflect->getParameters();
16
         $params = $reflect->getParameters();
27
             }
25
             }
28
         }
26
         }
29
 
27
 
30
-        return LuOutputFormatter::formatSuccess(call_user_func_array(array($business, $businessMethod), $args));
28
+        return LuOutputFormatter::formatSuccess(forward_static_call_array(array($businessClass, $businessMethod), $args));
31
     }
29
     }
32
 }
30
 }

+ 2
- 2
src/Utils/LuDbo.php View File

12
     }
12
     }
13
 
13
 
14
     /**
14
     /**
15
-     * @param $newClass $newClass
16
-     * @return mixed
15
+     * @param $newClass LuDbo
16
+     * @return LuDbo
17
      */
17
      */
18
     public function castAs($newClass) {
18
     public function castAs($newClass) {
19
         $obj = new $newClass;
19
         $obj = new $newClass;

Loading…
Cancel
Save