Add support for optional overrides array to $input->queryString() #28

merged 1 commit into from Nov 14, 2016


None yet

2 participants

teppokoivula commented Nov 5, 2016 edited

This feature is something I've found pretty useful when dealing with query strings: overriding existing GET params with custom ones, or adding new ones. While this can be done on a case-by-case basis with just a few lines of code, I thought it might also make sense as a core addition:

echo $input->queryString(); // action=edit&template=home

echo $input->queryString(array(
    'action' => 'rename',
    'limit' => 5,
)); // action=rename&template=home&limit=5

echo $input->queryString(array(
    'action' => null,
)); // template=home
@ryancramerdesign ryancramerdesign merged commit 0a12932 into processwire:dev Nov 14, 2016

Thanks Teppo, I have added this.


Thanks, Ryan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment