Properties

$namespace

$namespace : string

Namespace of the tag

Type

string

$name

$name : string

Name of the tag

Type

string

$value

$value : string

Value of the tag

Type

string

$compound

$compound : boolean

Whether this is a compound tag

Type

boolean

$sanitizers

$sanitizers : array<mixed,\BWP_Sitemaps_Sitemap_Sanitizer>

Sanitizers to apply on this tag's value

This is mostly relevant with a single tag because a compound tag does not actually have any value.

Type

array<mixed,\BWP_Sitemaps_Sitemap_Sanitizer>

$template

$template : string

Template to be used when rendering this tag

Type

string

$indent_level

$indent_level : integer

Level of indentation used when rendering this tag

Type

integer

Methods

create_single_tag()

create_single_tag(string  $name, string  $value = null,   $sanitizers = null) 

Create a single tag

Parameters

string $name
string $value

default to null

$sanitizers

create_compound_tag()

create_compound_tag(string  $name) 

Create a compound tag

Parameters

string $name

set_value()

set_value(string  $value) 

Set value for this tag

Parameters

string $value

add_sanitizer()

add_sanitizer(\BWP_Sitemaps_Sitemap_Sanitizer  $sanitizer) 

Add a sanitizer to apply upon this tag's value when set (if not existed)

Parameters

set_template()

set_template(string  $template) 

Set template for this tag

Parameters

string $template

is_compound()

is_compound() : boolean

Check whether this tag is a compound tag

Returns

boolean

get_name()

get_name() : string

Get tag name, with namespace

Returns

string

get_value()

get_value() : string

Get tag value

Returns

string

get_sanitizers()

get_sanitizers() 

Get registered sanitizers

get_template()

get_template() : string

Get tag template, with indentation prepended

Returns

string

get_indentation()

get_indentation() : string

Get indentation for this tag

Each parent corresponds to one level of indentation

Returns

string

get_xml()

get_xml() : string

Get XML representation of this tag

Returns

string

__construct()

__construct(  $name,   $is_compound = false) 

Parameters

$name
$is_compound