OSDN Git Service
(root)
/
php-libraries
/
Router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46f3178
)
Try to load class constructor when method name is not set or empty
author
Antoine Pous
<antoine@pous.so>
Sun, 18 Oct 2015 07:38:27 +0000
(09:38 +0200)
committer
Antoine Pous
<antoine@pous.so>
Sun, 18 Oct 2015 07:38:27 +0000
(09:38 +0200)
src/PHPRouter/Route.php
patch
|
blob
|
history
diff --git
a/src/PHPRouter/Route.php
b/src/PHPRouter/Route.php
index
2153cee
..
e6012fd
100755
(executable)
--- a/
src/PHPRouter/Route.php
+++ b/
src/PHPRouter/Route.php
@@
-169,6
+169,10
@@
class Route
$this->parameters = array($this->parameters);
}
+ if(empty($action[1]) || trim($action[1]) == '') {
+ $action[1] = '__construct';
+ }
+
call_user_func_array(array($instance, $action[1]), $this->parameters);
}
}