mPDF Manual – HTML control tags

# indexentry

(mPDF >= 1.0)

indexentry – Insert an Index entry for the document

## Description

<indexentry  $content [$xref ] />

Insert an Index entry for the document Index, referencing the current writing position in the document. If $xref is set, it will appear as a cross-referencing entry in the index as for IndexEntrySee(). ## Attributes$content

This attribute sets the text as it will appear in the Index entry. Text should be UTF-8 encoded.

$content cannot contain any of the characters: < > & ‘ or “ and must use the appropriate HTML entities e.g. <indexentry content=”&lt; 40” /> It is recommended that you use htmlspecialchars(‘Content’, ENT_QUOTES) for this. REQUIRED$xref

This attribute sets the text used as a cross-reference. Text should be UTF-8 encoded.

$xref cannot contain any of the characters: < > & ‘ or “ and must use the appropriate HTML entities e.g. <indexentry xref=”&lt; 40” /> It is recommended that you use e.g. htmlspecialchars($xref, ENT_QUOTES) for this.

Text entries passed in the form “Subject:Subcategory” will appear in the Index as “Subject, Subcategory”

OPTIONAL

## Changelog

VersionDescription
3.0 \$xref attribute added.

Example #1

Example #2

## Notes

Recommended placement of Index Entries is just after the first word following the opening tag of the block element:

or alternatively just after the opening tag of the block element:

or just after a word to be marked: