MissingComponentTrait

Type
Trait
Namespace
craft\base
Implemented by
craft\fields\MissingField, craft\fs\MissingFs, craft\widgets\MissingWidget
Since
3.0.0

MissingComponentTrait implements the common methods and properties for classes implementing craft\base\MissingComponentInterface.

View source (opens new window)

# Public Properties

Property Description
errorMessage string (opens new window), null (opens new window) – The exception message that explains why the component class was invalid
expectedType string (opens new window) – The expected component class name.
settings array (opens new window), null (opens new window) – The custom settings associated with the component, if it is savable

# errorMessage

Type
string (opens new window), null (opens new window)
Default value
null

The exception message that explains why the component class was invalid

View source (opens new window)

# expectedType

Type
string (opens new window)
Default value
null

The expected component class name.

View source (opens new window)

# settings

Type
array (opens new window), null (opens new window)
Default value
null

The custom settings associated with the component, if it is savable

View source (opens new window)

# Public Methods

Method Description
createFallback() Creates a new component of a given type based on this one’s properties.
getPlaceholderHtml() Displays an error message (and possibly a plugin install button) in place of the normal component UI.

# createFallback()

Creates a new component of a given type based on this one’s properties.

View source (opens new window)

Arguments

Returns

craft\base\ComponentInterface

# getPlaceholderHtml()

Since
3.0.6

Displays an error message (and possibly a plugin install button) in place of the normal component UI.

View source (opens new window)

Returns

string (opens new window)