aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Url.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 811f0fff7..f388054fc 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -13,13 +13,18 @@ class Minz_Url {
* $url['params'] = array of additional parameters
* or as a string
* @param string $encoding how to encode & (& ou & pour html)
+ * @param array{c?:string,a?:string,params?:array<string,mixed>} $amend Parameters to add or replace in the URL in its array form
* @return string Formatted URL
* @throws Minz_ConfigurationException
*/
- public static function display($url = [], string $encoding = 'html', bool|string $absolute = false): string {
+ public static function display(string|array $url = [], string $encoding = 'html', bool|string $absolute = false, array $amend = []): string {
$isArray = is_array($url);
if ($isArray) {
+ if (!empty($amend)) {
+ /** @var array{c?:string,a?:string,params?:array<string,mixed>} $url */
+ $url = array_replace_recursive($url, $amend);
+ }
$url = self::checkControllerUrl($url);
}