ComponentInterface extends Stringable

Common interface for all renderable backend components (buttons, dropdown items, etc.).

This interface provides the base contract for components that can be validated, typed, and rendered as HTML. It is extended by more specific interfaces like ButtonInterface and DropDownItemInterface.

Table of Contents

Methods

getType()  : string
Returns the fully qualified class name as the component type identifier.
isValid()  : bool
Validates whether the component is properly configured and can be rendered.
render()  : string
Renders the component as an HTML string.

Methods

getType()

Returns the fully qualified class name as the component type identifier.

public getType() : string

This is used to identify the specific component type in validation and rendering.

Return values
string

The fully qualified class name (e.g., 'TYPO3\CMS\Backend\Template\Components\Buttons\LinkButton')

isValid()

Validates whether the component is properly configured and can be rendered.

public isValid() : bool

Each implementing class defines its own validation rules (e.g., required fields).

Return values
bool

True if the component is valid and can be rendered, false otherwise

render()

Renders the component as an HTML string.

public render() : string

This method should only be called after validating the component with isValid(). The returned HTML is ready to be output to the browser.

Return values
string

The rendered HTML markup


        
On this page

Search results