function HTML::printToc
Print the table of contents for the standard.
The TOC is just an unordered list of bookmarks to sniffs on the page.
Return value
void
1 call to HTML::printToc()
- HTML::generate in vendor/
squizlabs/ php_codesniffer/ src/ Generators/ HTML.php - Generates the documentation for a standard.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Generators/ HTML.php, line 153
Class
Namespace
PHP_CodeSniffer\GeneratorsCode
protected function printToc() {
echo ' <h2>Table of Contents</h2>' . PHP_EOL;
echo ' <ul class="toc">' . PHP_EOL;
foreach ($this->docFiles as $file) {
$doc = new DOMDocument();
$doc->load($file);
$documentation = $doc->getElementsByTagName('documentation')
->item(0);
$title = $this->getTitle($documentation);
echo ' <li><a href="#' . str_replace(' ', '-', $title) . "\">{$title}</a></li>" . PHP_EOL;
}
echo ' </ul>' . PHP_EOL;
}