Skip to content

Kirby 5.0.4

Xml::tag()

Builds an XML tag

Xml::tag(string $name, array|string|null $content = '', array $attr = [ ], string|null $indent = null, int $level = 0): string

Parameters

Name Type Default Description
$namerequired string no default value Tag name
$content arrayorstringornull '' Scalar value or array with multiple lines of content or null to
generate a self-closing tag; pass an empty string to generate empty content
$attr array [ ] An associative array with additional attributes for the tag
$indent stringornull null Indentation string, defaults to two spaces or null for output on one line
$level int 0 Indentation level

Return type

string

The generated XML

Parent class

Kirby\Toolkit\Xml