Commit 62dee149 by Qiang Xue

Fixes #709.

parent dd5368b3
......@@ -191,17 +191,18 @@ class Sort extends Object
{
$attributes = array();
foreach ($this->attributes as $name => $attribute) {
if (is_array($attribute)) {
$attributes[$name] = $attribute;
if (!isset($attribute['label'])) {
$attributes[$name]['label'] = Inflector::camel2words($name);
}
} else {
if (!is_array($attribute)) {
$attributes[$attribute] = array(
'asc' => array($attribute => self::ASC),
'desc' => array($attribute => self::DESC),
'label' => Inflector::camel2words($attribute),
);
} elseif (!isset($attribute['asc'], $attribute['desc'], $attribute['label'])) {
$attributes[$name] = array_merge(array(
'asc' => array($name => self::ASC),
'desc' => array($name => self::DESC),
'label' => Inflector::camel2words($name),
), $attribute);
}
}
$this->attributes = $attributes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment