mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Added default to Utils::param()
This commit is contained in:
@@ -300,16 +300,17 @@ class Uri
|
||||
* Get URI parameter.
|
||||
*
|
||||
* @param string $id
|
||||
* @param bool $default
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public function param($id)
|
||||
public function param($id, $default = false)
|
||||
{
|
||||
if (isset($this->params[$id])) {
|
||||
return html_entity_decode(rawurldecode($this->params[$id]));
|
||||
}
|
||||
|
||||
return false;
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1260,7 +1260,7 @@ abstract class Utils
|
||||
*/
|
||||
public static function sortArrayByArray(array $array, array $orderArray)
|
||||
{
|
||||
$ordered = array();
|
||||
$ordered = [];
|
||||
foreach ($orderArray as $key) {
|
||||
if (array_key_exists($key, $array)) {
|
||||
$ordered[$key] = $array[$key];
|
||||
|
||||
Reference in New Issue
Block a user