Skip to content

Instantly share code, notes, and snippets.

@hailwood
Created March 1, 2015 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hailwood/fc09f756a608d1a5bcdd to your computer and use it in GitHub Desktop.
Save hailwood/fc09f756a608d1a5bcdd to your computer and use it in GitHub Desktop.
<?php
/* output:
array(3) [
string (13) "Parking Fines"
string (5) "Rates"
string (18) "Harbour Facilities"
]
*/
public function getCategoryPages(){
$pages = Page::get('Page', "Category{$this->Category}=1")->where("ClassName != 'CategoryPage'")->sort('MenuTitle ASC');
$list = new PaginatedList($pages, Controller::curr()->getRequest());
$list->setPageLength(16);
//begin debug
$titles = array();
foreach($list as $item){
$titles[] = $item->MenuTitle;
}
sd($titles);
//debug kills page
return $list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment