Skip to content

Commit

Permalink
fix url_params only pass 1 data
Browse files Browse the repository at this point in the history
  • Loading branch information
Haadiy Rozzaq committed Sep 21, 2017
1 parent bbb20ac commit 9fb3578
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/Core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct()

if (!empty($this->url_params)) {
// Call the method and pass arguments to it
call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
call_user_func_array(array($this->url_controller, $this->url_action), array($this->url_params));
} else {
// If no parameters are given, just call the method without parameters, like $this->home->method();
$this->url_controller->{$this->url_action}();
Expand Down Expand Up @@ -84,9 +84,10 @@ private function splitUrl()
$param = array_values($url);
for ($i=0; $i < count($param); $i++) {
if ($i % 2 == 0) {
$this->url_params[$param[$i]] = $param[$i+1];
$params[$param[$i]] = $param[$i+1];
}
}
$this->url_params = $params;
}

// for debugging. uncomment this if you have problems with the URL
Expand Down

1 comment on commit 9fb3578

@jgodstime
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working fine on my local host. but throwing error after deploying to my web server here is the error..
PHP Notice: Undefined offset: 1 in **********************/application/Core/Application.php on line 87

Please sign in to comment.