Update to 3.5.7.1
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace Kirby\Cms;
|
||||
|
||||
use Kirby\Data\Data;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* A collection of layouts
|
||||
* @since 3.5.0
|
||||
@@ -37,4 +40,27 @@ class Layouts extends Items
|
||||
|
||||
return parent::factory($items, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse layouts data
|
||||
*
|
||||
* @param array|string $input
|
||||
* @return array
|
||||
*/
|
||||
public static function parse($input): array
|
||||
{
|
||||
if (empty($input) === false && is_array($input) === false) {
|
||||
try {
|
||||
$input = Data::decode($input, 'json');
|
||||
} catch (Throwable $e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($input) === true) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
@@ -321,8 +321,8 @@ class Collection extends Iterator implements Countable
|
||||
/**
|
||||
* Alias for `Kirby\Toolkit\Collection::filter`
|
||||
*
|
||||
* @param string|Closure $field
|
||||
* @param array ...$args
|
||||
* @param string|array|\Closure $field
|
||||
* @param mixed ...$args
|
||||
* @return static
|
||||
*/
|
||||
public function filterBy(...$args)
|
||||
|
Reference in New Issue
Block a user