Added FlexCollection::sort() method

This commit is contained in:
Matias Griese
2019-01-25 10:40:28 +02:00
parent a09940ef6a
commit 3ace15d01a
2 changed files with 9 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
1. [](#improved)
* Added method argument `Data::filter($missingValuesAsNull)`, defaulting to `false`
* Improved `Grav\Common\User` class; added `$user->update()` method
* Added trim support for text input fields `validate: trim: true`
1. [](#bugfix)
* Fixed environment getting port added [#2284](https://github.com/getgrav/grav/issues/2284)
* Fixed `FlexForm::updateObject()` to update array values when they are empty in the form

View File

@@ -133,6 +133,10 @@ class Validation
$value = (string)$value;
if (!empty($params['trim'])) {
$value = trim($value);
}
if (isset($params['min']) && \strlen($value) < $params['min']) {
return false;
}
@@ -155,6 +159,10 @@ class Validation
protected static function filterText($value, array $params, array $field)
{
if (!empty($params['trim'])) {
$value = trim($value);
}
return (string) $value;
}