Added support for select multiple attribute in array filter

This commit is contained in:
Djamil Legato
2015-07-29 20:43:13 -07:00
parent b9f9570033
commit 0845b5e28a
2 changed files with 8 additions and 0 deletions

View File

@@ -126,6 +126,7 @@ form:
header.taxonomy:
type: taxonomy
label: Taxonomy
multiple: true
validate:
type: array

View File

@@ -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;
}