Skip to content

Instantly share code, notes, and snippets.

@fireflydev
Created June 10, 2013 15:38
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 fireflydev/5749743 to your computer and use it in GitHub Desktop.
Save fireflydev/5749743 to your computer and use it in GitHub Desktop.
Apollo FilterDirectory Example
<?php
public function songs($slug) {
$d = new FilterDirectory('songs');
$d -> SimpleQuery -> not_equal('artists.name', 'Rush') -> not_equal('artists.name', 'Paul Simon') -> descending('songs.title');
$d -> setResultsPerPage(5);
$d -> setHeader('<table id="songs" class="special">');
$d -> setFooter('</table><script>something();</script>');
$d -> setRepeatingRegion('
<tr>
<td>$title</td>
<td> $artists_name </td>
<td> <a href="/listen/$mp3_file">Listen Now! </a> </td>
<td> $artists_bio </td>
</tr>
');
$output = $d -> getResultsPerPage() . $d -> getHTML();
$p = new Page($title, $output);
$p -> setOther('Some other content on page');
return $p -> render();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment