Skip to content

Instantly share code, notes, and snippets.

@xu-chris
Last active August 29, 2015 14:12
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 xu-chris/0a581de896c30029d766 to your computer and use it in GitHub Desktop.
Save xu-chris/0a581de896c30029d766 to your computer and use it in GitHub Desktop.
Using search() for kellertheater.de
// Finds the specific description page for a play in 'repertoire'
function findDescriptionPage($name, $pages) {
// Break Conditions
if (empty($name) || empty($pages) || $pages->find('repertoire') == false) return false;
// First round: exact matches
if($result = $pages->find('repertoire')->children()->visible()->search($name, 'title|label|author|uid')) return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment