Skip to content

Commit 1961da6

Browse files
committed
🔨 improve on redirect() function to work a bit as route() helper function
Signed-off-by: otengkwame <[email protected]>
1 parent a116621 commit 1961da6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CodeIgniter/Framework/helpers/url_helper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,16 @@ function url_title($str, $separator = '-', $lowercase = false)
526526
* @param string $method Redirect method
527527
* 'auto', 'location' or 'refresh'
528528
* @param int $code HTTP Response status code
529-
* @return void
529+
* @return void|object
530530
*/
531531
function redirect($uri = '', $method = 'auto', $code = null)
532532
{
533533
$raw_uri = $uri;
534534

535+
if(empty($uri)) {
536+
return new \Base\Route\Route;
537+
}
538+
535539
if (strstr($uri, '.')) {
536540
$uri = str_replace('.', '/', $uri);
537541
}

0 commit comments

Comments
 (0)