Skip to content

Commit

Permalink
fix url() when used on index.php, #279
Browse files Browse the repository at this point in the history
  • Loading branch information
romaninsh committed Dec 3, 2017
1 parent 5f78d30 commit 3dec5d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,13 @@ public function url($page = [], $needRequestUri = false)
$result = [];

if ($this->page === null) {
$this->page = basename($this->getRequestURI(), '.php');
$uri = $this->getRequestURI();

if (substr($uri, -1, 1) == '/') {
$uri .= 'index.php';
}

$this->page = basename($uri, '.php');
}

// if page passed as string, then simply use it
Expand Down

0 comments on commit 3dec5d7

Please sign in to comment.