BlockInterface
API reference › HTML Contracts › Element › BlockInterface
Implemented by 1 type
Defines a contract for renderable HTML elements that use separate opening and closing tags.
In this library, “Block” refers to elements rendered with begin() and end() methods, not HTML’s
standard block-level content categories.
See also: https://developer.mozilla.org/en-US/docs/Glossary/Block-level_content.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
begin() abstract | Starts begin/end rendering for this instance. | BlockInterface |
end() static abstract | Ends the most recent begin/end rendering block for the current class. | BlockInterface |
render() abstract | Renders the object as an HTML string. | UIAwesome\ |
Method details
Section titled “Method details”begin()
Section titled “begin() ”abstract public function begin(): stringStarts begin/end rendering for this instance.
Returns the opening markup to the caller, who emits content between begin() and end().
Whitespace around streamed content is implementation-specific.
Returns
string: Opening HTML markup for the element.
end()
Section titled “end() ”abstract public static function end(): stringEnds the most recent begin/end rendering block for the current class.
Returns
string: Rendered HTML tag string.
Throws
LogicException: if no matchingbegin()call is found.RuntimeException: if the tag class does not match the expected type.