active link helper allow for arrays in target params

This commit is contained in:
2025-03-29 01:47:07 -07:00
parent 28d5856908
commit 3579ffd9c4

View File

@@ -62,7 +62,12 @@ class ActiveLinkHelper extends Helper
}
foreach ($target as $targetKey => $targetValue) {
if (is_array($targetValue)) {
return 'test';
if (!in_array($currentUrl[$targetKey], $targetValue)) {
return $this->Html->link($title, $url, $options);
}
$options['class'] = $this->_addClass($options);
return $this->Html->link($title, $url, $options);
}
if (!array_key_exists($targetKey, $currentUrl) || $targetValue != $currentUrl[$targetKey]) {
return $this->Html->link($title, $url, $options);