mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Merge branch 'development' of https://github.com/skipperbent/simple-php-router into development
Conflicts: src/Pecee/SimpleRouter/RouterBase.php
This commit is contained in:
@@ -220,10 +220,10 @@ class RouterBase {
|
||||
}
|
||||
|
||||
public function arrayToParams(array $getParams = null, $includeEmpty = true) {
|
||||
if(is_array($getParams) && count($getParams) > 0) {
|
||||
foreach($getParams as $key=>$val) {
|
||||
if(!empty($val) || empty($val) && $includeEmpty) {
|
||||
$getParams[$key] = $key.'='.$val;
|
||||
if (is_array($getParams) && count($getParams) > 0) {
|
||||
foreach ($getParams as $key => $val) {
|
||||
if (!empty($val) || empty($val) && $includeEmpty) {
|
||||
$getParams[$key] = $key . '=' . $val;
|
||||
}
|
||||
}
|
||||
return join('&', $getParams);
|
||||
@@ -345,6 +345,7 @@ class RouterBase {
|
||||
|
||||
$url = '/' . trim(join('/', $url), '/') . '/';
|
||||
|
||||
|
||||
if($getParams !== null && count($getParams)) {
|
||||
$url .= '?' . $this->arrayToParams($getParams);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user