Ciconia / A New Markdown Parser for #PHP

class Tag

HTML/XHTML/XML tag definition

Constants

TYPE_BLOCK

Block level tag

TYPE_INLINE

Inline level tag

Methods

__construct(string $name)

Constructor

Tag setText(Text|string $text)

Sets the inner text

Text getText()

Gets the inner text

$this setName(string $name)

Sets the name of the tag

string getName()

Returns the name of the tag

Tag setEmptyTagSuffix(string $emptyTagSuffix)

Sets the empty tag suffix

string getEmptyTagSuffix()

Returns the empty tag suffix

Tag setType(string $type)

Sets the type of the tag (Tag::TYPEBLOCK or Tag::TYPEINLINE)

string getType()

Returns the type of the tag

Tag setAttribute(string $attribute, string $value = null)

Sets an attribute

Tag setAttributes(array $attributes)

Sets attributes

Collection getAttributes()

Returns a collection of attributes

string render()

Renders the tag

string __toString()

Details

at line 53 public __construct(string $name)

Constructor

Parameters

string $name The name of the tag

at line 67 public Tag setText(Text|string $text)

Sets the inner text

Parameters

Text|string $text A string to set

Return Value

Tag

at line 83 public Text getText()

Gets the inner text

Return Value

Text

at line 95 public $this setName(string $name)

Sets the name of the tag

Parameters

string $name The name of the tag

Return Value

$this

at line 107 public string getName()

Returns the name of the tag

Return Value

string

at line 119 public Tag setEmptyTagSuffix(string $emptyTagSuffix)

Sets the empty tag suffix

Parameters

string $emptyTagSuffix The suffix

Return Value

Tag

at line 131 public string getEmptyTagSuffix()

Returns the empty tag suffix

Return Value

string The suffix

at line 143 public Tag setType(string $type)

Sets the type of the tag (Tag::TYPEBLOCK or Tag::TYPEINLINE)

Parameters

string $type The type of the tag

Return Value

Tag

at line 155 public string getType()

Returns the type of the tag

Return Value

string

at line 168 public Tag setAttribute(string $attribute, string $value = null)

Sets an attribute

Parameters

string $attribute The name of an attribute
string $value [optional] The value of an attribute

Return Value

Tag

at line 182 public Tag setAttributes(array $attributes)

Sets attributes

Parameters

array $attributes An array of attributes

Return Value

Tag

at line 196 public Collection getAttributes()

Returns a collection of attributes

Return Value

Collection

at line 206 public string render()

Renders the tag

Return Value

string The HTML string

at line 241 public string __toString()

Return Value

string