- Some fix into Paginator component for order / sort classic sintax

This commit is contained in:
Lucas Ferreira 2017-05-26 15:05:18 -03:00
parent 57ddc24b35
commit b539161b2d

View file

@ -382,13 +382,13 @@ class PaginatorComponent extends Component {
} }
return $options; return $options;
} }
if (!empty($options['order']) && is_array($options['order'])) { if (!empty($options['order']) && is_array($options['order'])) {
$order = array(); $order = array();
foreach ($options['order'] as $key => $value) { foreach ($options['order'] as $key => $value) {
if (is_int($key)) { if (is_int($key)) {
$key = $value; $field = explode(' ', $value);
$value = 'asc'; $key = $field[0];
$value = count($field) === 2 ? trim($field[1]) : 'asc';
} }
$field = $key; $field = $key;
$alias = $object->alias; $alias = $object->alias;