AbstractNode::render

The render() method generates the HTML representation of the node, with optional indentation to format the output.

The method allows you to control the level of indentation using the $indent parameter. The default behaviour is no indentation, but passing an integer value controls the indentation level, which increases with higher values.

Description

public AbstractNode::render(?int $indent = null): string

Parameters

$indent

An optional integer specifying the level of indentation.

  • null or 0: No indentation.
  • 1: Adds one level of tab indentation.
  • 2: Adds two levels of tab indentation, and so on.

Return Value

Returns a string containing the HTML representation of the node, indented as specified.

Exceptions

None

Source Code
If you find this project useful, consider leaving a on GitHub! Thank you!