我使用的是 cakephp 1.3。我试图使用 Set::sort() 函数对数组进行排序,但不工作..关于如何做到这一点的任何想法?下面是我使用的数组。
Array (
[0] => Array
(
[Group] => Array
(
[name] => Team A
)
[Members] => Array
(
[0] => Array
(
[name] => George
[Code] => Array
(
[name] => C
)
)
[1] => Array
(
[name] => Hall
[Code] => Array
(
[name] => A
)
)
[2] => Array
(
[name] => Mike
[Code] => Array
(
[name] => B
)
)
)
)
我使用这个对数组进行排序:
$data = Set::sort($data, '{n}.Members.{n}.Code.name', 'asc');
我期待这样的输出:
Array
(
[0] => Array
(
[Group] => Array
(
[name] => Team A
)
[Members] => Array
(
[0] => Array
(
[name] => Hall
[Code] => Array
(
[name] => A
)
)
[1] => Array
(
[name] => Mike
[Code] => Array
(
[name] => B
)
)
[2] => Array
(
[name] => George
[Code] => Array
(
[name] => C
)
)
)
)
排序不生效。我该怎么做?任何想法?