File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
templates/element/Packages Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 99$ tagGroups = $ package ->cake_php_tag_groups ;
1010krsort ($ tagGroups );
1111$ existingSlugs = (array )($ query ['cakephp_slugs ' ] ?? []);
12+ $ currentPath = $ this ->getRequest ()->getPath () ?: '/ ' ;
13+ $ buildFilterUrl = static function (string $ path , array $ params ): string {
14+ $ queryString = http_build_query ($ params , '' , '& ' , PHP_QUERY_RFC3986 );
15+ $ queryString = preg_replace ('/%5B\d+%5D=/ ' , '%5B%5D= ' , $ queryString ) ?? $ queryString ;
16+
17+ return $ queryString === '' ? $ path : $ path . '? ' . $ queryString ;
18+ };
1219$ packageId = preg_replace ('/[^a-z0-9]/i ' , '- ' , strtolower ($ package ->package ));
1320$ dialogId = 'compat- ' . $ packageId ;
1421?>
@@ -108,7 +115,7 @@ class="btn btn-xs <?= $isActive ? 'btn-primary' : 'btn-soft btn-primary' ?>">
108115 : array_values (array_unique (array_merge ($ existingSlugs , [$ slug ])));
109116 unset($ tagQuery ['page ' ]);
110117 ?>
111- <a href="<?= h ($ this -> Url -> build ([ ' ? ' => $ tagQuery] )) ?> "
118+ <a href="<?= h ($ buildFilterUrl ( $ currentPath , $ tagQuery )) ?> "
112119 class="btn btn-xs <?= $ tagIsActive ? 'btn-error ' : 'btn-soft btn-error ' ?> ">
113120 <?= h (str_replace ('CakePHP: ' , '' , $ tag ->label )) ?>
114121 </a>
You can’t perform that action at this time.
0 commit comments