function getSorter() { $sorts = array('Most Popular' => 'Popularity DESC', ListSorter_Option::create('Title (A - Z)', "Title ASC", ListSorter_Option::create('Title (Z - A)', "Title DESC")->setID("title desc"))->setID("title asc"), ListSorter_Option::create('Newest', "Created DESC", ListSorter_Option::create('Oldest', "Created ASC"))); $sorter = new ListSorter($this->request, $sorts); $this->extend('updateSorter', $sorter); return $sorter; }