Skip to content

Instantly share code, notes, and snippets.

@hailwood
Created March 18, 2015 02:34
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/6cb2f676a0d6b74867a7 to your computer and use it in GitHub Desktop.
Save hailwood/6cb2f676a0d6b74867a7 to your computer and use it in GitHub Desktop.
<?php
class Page extends SiteTree {
//...
public function DMSTags($category = null){
$docs = $this->Documents();
$tags = [];
/** @var DMSDocument $doc */
foreach($docs as $doc){
foreach($doc->Tags() as $tag){
$tags[$tag->ID] = $tag;
}
}
return $tags
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment