mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 19:15:34 +02:00
Added FlexCollection::sort() method
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user