added test cases, remove activeClass from output if no target set
All checks were successful
CI / testsuite (sqlite, 8.2, ) (push) Successful in 12m46s
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Successful in 12m35s
CI / testsuite (sqlite, 8.4, ) (push) Successful in 10m20s
CI / Coding Standard & Static Analysis (push) Successful in 13m51s
CI / testsuite (mysql, 8.2, ) (push) Successful in 5m9s
CI / testsuite (mysql, 8.4, ) (push) Successful in 6m20s
CI / testsuite (pgsql, 8.2, ) (push) Successful in 5m16s
CI / testsuite (pgsql, 8.4, ) (push) Successful in 5m51s
All checks were successful
CI / testsuite (sqlite, 8.2, ) (push) Successful in 12m46s
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Successful in 12m35s
CI / testsuite (sqlite, 8.4, ) (push) Successful in 10m20s
CI / Coding Standard & Static Analysis (push) Successful in 13m51s
CI / testsuite (mysql, 8.2, ) (push) Successful in 5m9s
CI / testsuite (mysql, 8.4, ) (push) Successful in 6m20s
CI / testsuite (pgsql, 8.2, ) (push) Successful in 5m16s
CI / testsuite (pgsql, 8.4, ) (push) Successful in 5m51s
This commit is contained in:
@@ -42,6 +42,8 @@ class ActiveLinkHelper extends Helper {
|
||||
public function link(array|string $title, array|string|null $url = null, array $options = []): string {
|
||||
$currentUrl = $options['current'] ?? Router::parseRequest($this->getView()->getRequest());
|
||||
if (!array_key_exists('target', $options) || !$currentUrl) {
|
||||
unset($options['activeClass']);
|
||||
|
||||
return $this->Html->link($title, $url, $options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user