Allow static methods to be called using a string.

pull/279/head v1.2.21
Mike Cao 9 years ago
parent 7f402f805a
commit ec24d78602

@ -1 +1 @@
1.2.20 1.2.21

@ -155,6 +155,11 @@ class Dispatcher {
* @return mixed Function results * @return mixed Function results
*/ */
public static function callFunction($func, array &$params = array()) { public static function callFunction($func, array &$params = array()) {
// Call static method
if (is_string($func) && strpos($func, '::') !== false) {
return call_user_func_array($func, $params);
}
switch (count($params)) { switch (count($params)) {
case 0: case 0:
return $func(); return $func();

Loading…
Cancel
Save