mirror of
https://github.com/getgrav/grav.git
synced 2026-01-31 20:00:21 +01:00
Added support for select multiple attribute in array filter
This commit is contained in:
@@ -126,6 +126,7 @@ form:
|
||||
header.taxonomy:
|
||||
type: taxonomy
|
||||
label: Taxonomy
|
||||
multiple: true
|
||||
validate:
|
||||
type: array
|
||||
|
||||
|
||||
@@ -492,6 +492,7 @@ class Validation
|
||||
{
|
||||
$values = (array) $value;
|
||||
$options = isset($field['options']) ? array_keys($field['options']) : array();
|
||||
$multi = isset($field['multiple']) ? $field['multiple'] : false;
|
||||
|
||||
if ($options) {
|
||||
$useKey = isset($field['use']) && $field['use'] == 'keys';
|
||||
@@ -500,6 +501,12 @@ class Validation
|
||||
}
|
||||
}
|
||||
|
||||
if ($multi) {
|
||||
foreach ($values as $key => $value) {
|
||||
$values[$key] = explode(',', $value[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user