Skip to content

Commit

Permalink
[FIX] Route with action ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed May 14, 2024
1 parent ab484b4 commit 80f2370
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/Controllers/sSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@

class sSettingsController
{
//public $url;

/**
* Construct
*/
public function __construct()
{
//$this->url = $this->moduleUrl();
//Paginator::defaultView('pagination');
}

/**
* Show tabs with custom system settings
*
Expand Down
6 changes: 6 additions & 0 deletions src/Facades/sSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

use Illuminate\Support\Facades\Facade;

/**
* Class sSettings
*
* @package Seiger\sSettings
* @mixin \Seiger\sSettings\sSettings
*/
class sSettings extends Facade
{
/**
Expand Down
12 changes: 10 additions & 2 deletions src/sSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function listType(): array
}

/**
* Get url from route name
* Get url from route name with action id
*
* @param string $name Route name
* @return string
Expand All @@ -42,6 +42,14 @@ public function route(string $name): string
if (evo()->getConfig('friendly_url_suffix', '') != '/') {
$route = str_ireplace(evo()->getConfig('friendly_url_suffix', ''), '', route($name));
}
return $route;

$a = 0;
$arr = str_split($name, 1);
foreach ($arr as $n) {
$a += ord($n);
}
$a = $a < 999 ? $a + 999 : $a;

return $route.'?a='.$a;
}
}

0 comments on commit 80f2370

Please sign in to comment.