Skip to content

Commit

Permalink
fix: argument resolving in allIndex method
Browse files Browse the repository at this point in the history
  • Loading branch information
ipranjal committed Jun 24, 2020
1 parent 9f9cced commit 3dc6e46
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/RouterEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,12 @@ private function getMethod($controller) {
//If second argument not set switch to Index function
if (!isset($this->path_info[1])) {
if (method_exists($controller, $function = $this->request_method . 'Index')) {
$last=end($this->path_info);
array_pop($this->path_info);
array_push($this->path_info, "", $last);
array_shift($this->path_info);
return $function;
}
if (!isset($this->path_info[0])) {
if (method_exists($controller, $function = 'allIndex')) {
$last=end($this->path_info);
array_pop($this->path_info);
array_push($this->path_info, "", $last);
array_shift($this->path_info);
return $function;
}
}
Expand Down

0 comments on commit 3dc6e46

Please sign in to comment.