{"$schema":"https://yii2-framework.github.io/docs/reference/reference.schema.json","schemaVersion":1,"package":"html-contracts","title":"HTML Contracts","repository":"https://github.com/ui-awesome/html-contracts","ref":"main","commit":"cf950b1614c5b1e05d51f6518bd1925d5a04e184","generatedAt":"2026-11-20","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/","types":{"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/attribute/attributesinterface/","summary":"Defines the public contract for objects that manage HTML attributes.","methods":{"addAttribute":{"signature":"abstract public function addAttribute(string|UnitEnum $key, mixed $value): static","summary":"Adds or updates a single HTML attribute for the element.","params":[{"name":"$key","type":"string|UnitEnum","description":"Attribute name."},{"name":"$value","type":"mixed","description":"Attribute value. Use `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated attribute."},"abstract":true},"attributes":{"signature":"abstract public function attributes(mixed[] $values): static","summary":"Adds or updates the supplied HTML attributes, preserving all other attributes.","params":[{"name":"$values","type":"mixed[]","description":"Associative array of attribute keys and values."}],"return":{"type":"static","description":"New instance with the updated attributes."},"abstract":true},"class":{"signature":"abstract public function class(string|Stringable|UnitEnum|null $value, bool $override = false): static","summary":"Sets the `class` attribute.","params":[{"name":"$value","type":"string|Stringable|UnitEnum|null","description":"CSS class value, or `null` to remove the attribute."},{"name":"$override","type":"bool","default":"false","optional":true,"description":"Whether to override existing classes (`true`) or merge (`false`)."}],"return":{"type":"static","description":"New instance with the updated `class` attribute."},"abstract":true},"getAttribute":{"signature":"abstract public function getAttribute(string|UnitEnum $key, mixed $default = null): mixed","summary":"Returns the value of a single HTML attribute.","params":[{"name":"$key","type":"string|UnitEnum","description":"Attribute name."},{"name":"$default","type":"mixed","default":"null","optional":true,"description":"Default value when the attribute is missing."}],"return":{"type":"mixed","description":"Attribute value or default."},"abstract":true},"getAttributes":{"signature":"abstract public function getAttributes(): mixed[]","summary":"Returns the array of HTML attributes for the element.","return":{"type":"mixed[]","description":"Attributes array assigned to the element."},"abstract":true},"removeAttribute":{"signature":"abstract public function removeAttribute(string|UnitEnum $key): static","summary":"Removes a specific HTML attribute from the element.","params":[{"name":"$key","type":"string|UnitEnum","description":"Attribute name to remove."}],"return":{"type":"static","description":"New instance without the specified attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Attribute\\SrcInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/attribute/srcinterface/","summary":"Defines the contract for elements that expose the `src` attribute.","methods":{"src":{"signature":"abstract public function src(string|Stringable|UnitEnum|null $value): static","summary":"Sets the `src` attribute.","params":[{"name":"$value","type":"string|Stringable|UnitEnum|null","description":"URL of the embedded resource, or `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated `src` attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Attribute\\ValueInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/attribute/valueinterface/","summary":"Defines the contract for elements that expose a single-valued `value` attribute.","methods":{"value":{"signature":"abstract public function value(bool|float|int|string|Stringable|UnitEnum|null $value): static","summary":"Sets the `value` attribute.","params":[{"name":"$value","type":"bool|float|int|string|Stringable|UnitEnum|null","description":"Scalar value, or `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated `value` attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Element\\BlockInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/element/blockinterface/","summary":"Defines a contract for renderable HTML elements that use separate opening and closing tags.","implements":["UIAwesome\\Html\\Contracts\\RenderableInterface"],"methods":{"begin":{"signature":"abstract public function begin(): string","summary":"Starts begin/end rendering for this instance.","return":{"type":"string","description":"Opening HTML markup for the element."},"abstract":true},"end":{"signature":"abstract public static function end(): string","summary":"Ends the most recent begin/end rendering block for the current class.","return":{"type":"string","description":"Rendered HTML tag string."},"throws":[{"type":"LogicException","description":"if no matching `begin()` call is found."},{"type":"RuntimeException","description":"if the tag class does not match the expected type."}],"static":true,"abstract":true}},"inherited":{"methods":{"render":"UIAwesome\\Html\\Contracts\\RenderableInterface"}}},"UIAwesome\\Html\\Contracts\\Element\\ClearableContentInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/element/clearablecontentinterface/","summary":"Defines an optional immutable API for clearing accumulated element content.","implements":["UIAwesome\\Html\\Contracts\\Element\\ContentInterface"],"methods":{"clearContent":{"signature":"abstract public function clearContent(): static","summary":"Clears encoded and raw content without changing other component state.","return":{"type":"static","description":"New instance with empty content."},"abstract":true}},"inherited":{"methods":{"content":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface","getContent":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface","html":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface"}}},"UIAwesome\\Html\\Contracts\\Element\\ContentInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/element/contentinterface/","summary":"Defines the contract for elements that accept child content.","methods":{"content":{"signature":"abstract public function content(string|Stringable|UnitEnum ...$values): static","summary":"Appends encoded content.","params":[{"name":"$values","type":"string|Stringable|UnitEnum","optional":true,"variadic":true,"description":"Content to be encoded and appended."}],"return":{"type":"static","description":"New instance with appended encoded content."},"abstract":true},"getContent":{"signature":"abstract public function getContent(): string","summary":"Returns the content assigned to the element.","return":{"type":"string","description":"Content value assigned to the element. Never `null`."},"abstract":true},"html":{"signature":"abstract public function html(string|Stringable|UnitEnum ...$values): static","summary":"Appends trusted raw HTML content without encoding or sanitizing it.","params":[{"name":"$values","type":"string|Stringable|UnitEnum","optional":true,"variadic":true,"description":"Trusted raw HTML content to be appended."}],"return":{"type":"static","description":"New instance with appended raw HTML content."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Element\\InlineInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/element/inlineinterface/","summary":"Defines a contract for renderable HTML elements that render as single-line elements.","implements":["UIAwesome\\Html\\Contracts\\Element\\ContentInterface","UIAwesome\\Html\\Contracts\\RenderableInterface"],"inherited":{"methods":{"content":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface","getContent":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface","html":"UIAwesome\\Html\\Contracts\\Element\\ContentInterface","render":"UIAwesome\\Html\\Contracts\\RenderableInterface"}}},"UIAwesome\\Html\\Contracts\\Element\\VoidInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/element/voidinterface/","summary":"Defines a contract for renderable HTML elements that represent void (self-closing) elements.","implements":["UIAwesome\\Html\\Contracts\\RenderableInterface"],"inherited":{"methods":{"render":"UIAwesome\\Html\\Contracts\\RenderableInterface"}}},"UIAwesome\\Html\\Contracts\\Form\\CheckedStateInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/form/checkedstateinterface/","summary":"Defines the contract for form controls that expose the `checked` attribute.","methods":{"checked":{"signature":"abstract public function checked(mixed[]|bool|float|int|string|Stringable|UnitEnum|null $value): static","summary":"Sets the `checked` attribute.","params":[{"name":"$value","type":"mixed[]|bool|float|int|string|Stringable|UnitEnum|null","description":"Value matched against the control value to resolve the checked state, or `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated `checked` attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Form\\ChoiceListInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/form/choicelistinterface/","summary":"Defines the contract for form controls that render a list of choices.","methods":{"enclosedByLabel":{"signature":"abstract public function enclosedByLabel(bool $value = true): static","summary":"Sets whether each choice is wrapped by its own `<label>` element.","params":[{"name":"$value","type":"bool","default":"true","optional":true,"description":"Whether to enclose each choice by a `<label>` element."}],"return":{"type":"static","description":"New instance with the updated enclosing behavior."},"abstract":true},"isList":{"signature":"abstract public function isList(): true","summary":"Identifies the control as one that renders a list of choices.","return":{"type":"true","description":"Always `true`."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Form\\FormControlInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/form/formcontrolinterface/","summary":"Defines the contract for form control elements (inputs, selects, textareas, etc.).","implements":["UIAwesome\\Html\\Contracts\\RenderableInterface","UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface"],"inherited":{"methods":{"addAttribute":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","attributes":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","class":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","getAttribute":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","getAttributes":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","removeAttribute":"UIAwesome\\Html\\Contracts\\Attribute\\AttributesInterface","render":"UIAwesome\\Html\\Contracts\\RenderableInterface"}}},"UIAwesome\\Html\\Contracts\\Form\\MultiValueInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/form/multivalueinterface/","summary":"Defines the contract for form controls that accept one or many values.","methods":{"value":{"signature":"abstract public function value(mixed[]|bool|float|int|string|Stringable|UnitEnum|null $value): static","summary":"Sets the `value` attribute.","params":[{"name":"$value","type":"mixed[]|bool|float|int|string|Stringable|UnitEnum|null","description":"Single value or set of selected values, or `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated `value` attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\Form\\PlaceholderInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/form/placeholderinterface/","summary":"Defines the contract for form controls that expose the `placeholder` attribute.","methods":{"placeholder":{"signature":"abstract public function placeholder(string|Stringable|UnitEnum|null $value): static","summary":"Sets the `placeholder` attribute.","params":[{"name":"$value","type":"string|Stringable|UnitEnum|null","description":"Expected-value hint, or `null` to remove the attribute."}],"return":{"type":"static","description":"New instance with the updated `placeholder` attribute."},"abstract":true}}},"UIAwesome\\Html\\Contracts\\RenderableInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/html-contracts/reference/renderableinterface/","summary":"Defines the contract for objects that can be rendered as HTML strings.","implements":["Stringable"],"methods":{"render":{"signature":"abstract public function render(): string","summary":"Renders the object as an HTML string.","return":{"type":"string","description":"Rendered HTML output."},"abstract":true}}}}}
