| @@ 60-65 (lines=6) @@ | ||
| 57 | } |
|
| 58 | // sort |
|
| 59 | $pages = $pages->sortByDate(); |
|
| 60 | if ($sortby) { |
|
| 61 | $sortMethod = sprintf('sortBy%s', ucfirst($sortby)); |
|
| 62 | if (method_exists($pages, $sortMethod)) { |
|
| 63 | $pages = $pages->$sortMethod(); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| 67 | // build pagination |
|
| 68 | $pagesTotal = count($pages); |
|
| @@ 47-52 (lines=6) @@ | ||
| 44 | $pages = new PagesCollection($section, $pagesAsArray); |
|
| 45 | // sort |
|
| 46 | $pages = $pages->sortByDate(); |
|
| 47 | if ($page->getVariable('sortby')) { |
|
| 48 | $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby'))); |
|
| 49 | if (method_exists($pages, $sortMethod)) { |
|
| 50 | $pages = $pages->$sortMethod(); |
|
| 51 | } |
|
| 52 | } |
|
| 53 | // add navigation links |
|
| 54 | $this->addNavigationLinks($pages); |
|
| 55 | // create page for each section |
|