From bbf191887eb309c7e2f7e57d102feeced8a2c32f Mon Sep 17 00:00:00 2001 From: Bram de Leeuw Date: Fri, 18 Nov 2022 16:49:02 +0100 Subject: [PATCH] Don't pop when the last param is an ID --- src/DefaultLink.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DefaultLink.php b/src/DefaultLink.php index 1864726..2ffd329 100644 --- a/src/DefaultLink.php +++ b/src/DefaultLink.php @@ -48,7 +48,10 @@ public function getModelLink($action, array $params = null) $dirParts = array_slice($dirParts, 3); // replace the current action - array_pop($dirParts); + if (!is_numeric(end($dirParts))) { + array_pop($dirParts); + } + $dirParts[] = 'doCustomLink'; $action = implode('/', $dirParts);