-
Notifications
You must be signed in to change notification settings - Fork 1
Issue/12 change lang url #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
============================================
+ Coverage 36.6% 38.32% +1.72%
- Complexity 81 91 +10
============================================
Files 3 3
Lines 265 287 +22
============================================
+ Hits 97 110 +13
- Misses 168 177 +9
Continue to review full report at Codecov.
|
src/View/Helper/I18nHelper.php
Outdated
| if ($request->getUri()->getQuery()) { | ||
| $url .= '?' . $request->getUri()->getQuery(); | ||
|
|
||
| return $path . (!empty($query) ? '?' . $query : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer
if (!empty($query)) {
$path .= sprintf('?%s', $query);
}
return $path;
src/Middleware/I18nMiddleware.php
Outdated
| * Define when I18n rules are applied with `/:lang` prefix: | ||
| * - 'match': array of URL paths, if there's an exact match rule is applied | ||
| * - 'startWith': array of URL paths, if current URL path starts with one of these rule is applied | ||
| * - 'switchLangUrl': reserved URL (for example `/lang`) used to switch lang and redirect to custom URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] we can change and redirect to custom URL. to and redirect to referer URL.
This PR fixes #12