Skip to content

Commit

Permalink
Update helper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Apr 8, 2022
1 parent ec9ddf4 commit dcb5bb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ function addons_url($url = '', $param = [], $suffix = true, $domain = false)
$controller = explode('.',$controller)[1];
$action = $request->action();
} else {
$route = explode('/', trim($url['path'],'/'));
$route = explode('/', trim($url['path'],'/'));
$action = array_pop($route);
$addons = count($route) == 3 ? strtolower($route[0]) : $request->addon;
$controller = (array_pop($route)) ?: $request->param('controller');
$addons = isset($url['scheme'])? strtolower($url['scheme']) : (count($route) == 3 ? strtolower($route[0]) : $request->addon);
$controller = isset($url['host'])?$url['host'] : (array_pop($route) ?: $request->param('controller'));
$module = (array_pop($route)) ?: $request->param('module', 'frontend');
$module = lcfirst($module);
$controller = lcfirst(Str::studly((string)$controller));
Expand Down

0 comments on commit dcb5bb0

Please sign in to comment.