Extensible BBCode  8.x-3.x-dev
 All Classes Namespaces Files Functions Variables
Element Class Reference
Inheritance diagram for Element:
ElementInterface RootElement

Public Member Functions

 __construct (array $regex_set=NULL)
 
 append (Element $tag, $offset)
 
 advance ($text, $offset)
 
 breakTag (Element $tag)
 
 attr ($name=NULL)
 
 content ()
 
 option ()
 
 source ()
 
 outerSource ()
 

Detailed Description

A node in the tag tree.

Definition at line 13 of file Element.php.

Constructor & Destructor Documentation

__construct ( array  $regex_set = NULL)

Construct an element out of a regex match.

Parameters
array$regex_setThe data returned from preg_match() for a single match, including string offsets.

Definition at line 21 of file Element.php.

References Element\content(), and Element\option().

Member Function Documentation

advance (   $text,
  $offset 
)

Append ordinary text to the content.

Parameters
string$textThe complete source text.
int$offsetThe character position of the end of the substring to append.

Definition at line 77 of file Element.php.

References Element\content().

append ( Element  $tag,
  $offset 
)

Append a completed element to the content.

Parameters
Element$tagThe element to be appended.
int$offsetThe character position of the end of the element.

Definition at line 64 of file Element.php.

References Element\content().

attr (   $name = NULL)

{Retrieve a particular attribute of the element.[tag NAME=VALUE]...[/tag]

Parameters
string$nameThe name of the attribute, or NULL.
Returns
string | array The value of this attribute, or NULL if it isn't set. If no name was given, all attributes are returned in an array.
}

Implements ElementInterface.

Definition at line 100 of file Element.php.

breakTag ( Element  $tag)

Append a broken element to the content.

This will attach that element's dangling opening tag, as well as its content.

Parameters
Element$tagThe broken element to append.

Definition at line 91 of file Element.php.

References Element\content().

content ( )

{Retrieve the content of the tag.[tag]CONTENT[/tag]All BBCode inside this content will already be rendered.

Returns
string The tag content.
}

Implements ElementInterface.

Definition at line 107 of file Element.php.

Referenced by RootElement\__construct(), Element\__construct(), Element\advance(), Element\append(), and Element\breakTag().

option ( )

{Retrieve the option-type attribute of the element.[tag=OPTION]...[/tag]

Returns
string The value of the option.
}

Implements ElementInterface.

Definition at line 114 of file Element.php.

Referenced by Element\__construct().

outerSource ( )

{Retrieve the complete source, including the opening and closing tags.

Returns
string The tag source.
}

Implements ElementInterface.

Definition at line 128 of file Element.php.

References Element\source().

source ( )

{Retrieve the content source of the tag.[tag]CONTENT[/tag]This is the content of the tag before rendering.

Returns
string The tag content source.
}

Implements ElementInterface.

Definition at line 121 of file Element.php.

Referenced by Element\outerSource().


The documentation for this class was generated from the following file: