Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 4371c84

Browse files
authored
set empty path to '/' for standard skeleton app home-page
1 parent 7c51cc6 commit 4371c84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/book/v3/cookbook/setting-locale-without-routing-parameter.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ class SetLocaleMiddleware implements MiddlewareInterface
6868
Locale::setDefault(Locale::canonicalize($locale));
6969
$this->helper->setBasePath($locale);
7070

71+
$path = substr($path, strlen($locale) + 1);
72+
7173
return $handler->handle($request->withUri(
72-
$uri->withPath(substr($path, strlen($locale) + 1))
74+
$uri->withPath(path ?: '/')
7375
));
7476
}
7577
}

0 commit comments

Comments
 (0)