Admin Page Framework Documentation

Packages

  • AdminPageFramework
    • Common
      • Factory
      • Form
        • FieldType
      • Utility
    • Factory
      • AdminPage
      • MetaBox
      • NetworkAdmin
      • PageMetaBox
      • PostType
      • TaxonomyField
      • TermMeta
      • UserMeta
      • Widget
    • Utility

Classes

  • AdminPageFramework_ClassTester
  • AdminPageFramework_PluginBootstrap
  • AdminPageFramework_PointerToolTip
  • AdminPageFramework_Requirement
  • AdminPageFramework_TableOfContents
  • AdminPageFramework_WPReadmeParser
  • AdminPageFramework_WPUtility_Time
  • AdminPageFramework_Zip

Resources

  • Tutorials
  • Support
  • Reporting Issues

Class AdminPageFramework_TableOfContents

Generates an HTML Table of Contents block.

This parses given text and generate headings with links to the heading elements. It helps the viewer browse the vertically long contents. Use this class to create a help page from existent text document.

Usage

Pass text data to the first parameter and the depth of nested headings to the second parameter. Then use the get() method to retrieve the generated output.

Example

$_oTOC = new AdminPageFramework_TableOfContents( $sText, 4 );
$_sTOC = $_oTOC->get();
Package: AdminPageFramework\Utility
Copyright: Copyright (c) 2013-2022, Michael Uno
Author: Michael Uno
Since: 3.5.0
Image: http://admin-page-framework.michaeluno.jp/image/utility/table_of_contents.png
Located at utility/toc/AdminPageFramework_TableOfContents.php

Methods summary

public
# __construct( string $sHTML, integer $iDepth = 4, string $sTitle = '' )

Sets up properties.

Parameters

$sHTML
string
$sHTML The HTML text to parse.
$iDepth
integer
$iDepth The header number to parse.
$sTitle
string
$sTitle The heading title which appears at the beginning of the output.
public string
# get( )

Returns the TOC block and the contents.

Returns

string

Since

3.5.0

See

http://www.10stripe.com/articles/automatically-generate-table-of-contents-php.php

Magic methods summary

Related

If you find undocumented functionality, please report it here.

Admin Page Framework