Skip to content

Commit 553fe9d

Browse files
committed
🔧 get a named route through url() helper function
Signed-off-by: otengkwame <[email protected]>
1 parent 9741243 commit 553fe9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Core/helpers/ci_core_helper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ function url($uri = '', $param = '', $protocol = null)
303303
return void_url();
304304
}
305305

306+
if (Route::getName($uri)) {
307+
return route()->named($uri);
308+
}
309+
306310
// Detect if the $uri is string and starts with 'https://' or 'http://'
307311
if (is_string ($uri) && (strpos($uri, 'https://') === 0 || strpos($uri, 'http://') === 0)) {
308312
return $uri . $param;

0 commit comments

Comments
 (0)