Permalink
Browse files

Sort summary

  • Loading branch information...
1 parent 418d5e8 commit 14487c742c31b5074e9184cf4c6e80450e05dba2 @sanpii committed Apr 19, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 index.php
View
@@ -47,9 +47,22 @@ private function getSummary()
$title = $titles[$rule->id{0}];
$summary[$title][] = $rule;
}
+ $this->sortSummary($summary);
return $summary;
}
+ private function sortSummary(&$summary)
+ {
+ foreach ($summary as &$entries) {
+ uasort($entries, function($a, $b) {
+ return strnatcmp(
+ substr($a->id, 1),
+ substr($b->id, 1)
+ );
+ });
+ }
+ }
+
private function render($params)
{
extract($params);

0 comments on commit 14487c7

Please sign in to comment.