Skip to content
PHP Ecosystem
Explore

BlockInterface

API reference › HTML Contracts › Element › BlockInterface

interfaceUIAwesome\Html\Contracts\Element\BlockInterface
ExtendsUIAwesome\Html\Contracts\RenderableInterface
Sourcesrc/Element/BlockInterface.php
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.

MethodDescriptionDefined by
begin() abstractStarts begin/end rendering for this instance.BlockInterface
end() static abstractEnds the most recent begin/end rendering block for the current class.BlockInterface
render() abstractRenders the object as an HTML string.UIAwesome\Html\Contracts\RenderableInterface
abstract public function begin(): string

Starts 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.

abstract public static function end(): string

Ends the most recent begin/end rendering block for the current class.

Returns

string: Rendered HTML tag string.

Throws