Skip to content

Commit

Permalink
Testing & refactoring in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Nov 16, 2023
1 parent 8199b4b commit 1e905d2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,22 @@ public function __construct(
} elseif (str_contains($uri_path, $this->getAppBasePath())) {

$recomputed_uri =
str_starts_with($this->getAppBasePath(), '/')
? $req->getUri()->withPath("{$this->getAppBasePath()}/{$this->controller_name_from_uri}/{$this->action_name_from_uri}")
: $req->getUri()->withPath("/{$this->getAppBasePath()}/{$this->controller_name_from_uri}/{$this->action_name_from_uri}");
(
$this->controller_name_from_uri !== ''
&& $this->action_name_from_uri !== ''
)
?
(
str_starts_with($this->getAppBasePath(), '/')
? $req->getUri()->withPath("{$this->getAppBasePath()}/{$this->controller_name_from_uri}/{$this->action_name_from_uri}")
: $req->getUri()->withPath("/{$this->getAppBasePath()}/{$this->controller_name_from_uri}/{$this->action_name_from_uri}")
)
:
(
str_starts_with($this->getAppBasePath(), '/')
? $req->getUri()->withPath("{$this->getAppBasePath()}/{$this->controller_name_from_uri}")
: $req->getUri()->withPath("/{$this->getAppBasePath()}/{$this->controller_name_from_uri}")
);
}

$this->current_uri_computed = sMVC_UriToString($recomputed_uri);
Expand Down

0 comments on commit 1e905d2

Please sign in to comment.