MissingComponentTrait ​
- Type
- Trait
- Namespace
- craft\base
- Implemented by
- craft\fields\MissingField, craft\volumes\MissingVolume, craft\widgets\MissingWidget
- Since
- 3.0.0
MissingComponentTrait implements the common methods and properties for classes implementing craft\base\MissingComponentInterface.
Public Properties ​
Property | Description |
---|---|
errorMessage | string, null – The exception message that explains why the component class was invalid |
expectedType | string, craft\base\Component, null – The expected component class name. |
settings | mixed – The custom settings associated with the component, if it is savable |
errorMessage
​
The exception message that explains why the component class was invalid
expectedType
​
- Type
- string, craft\base\Component, null
- Default value
null
The expected component class name.
settings
​
- Type
mixed
- Default value
null
The custom settings associated with the component, if it is savable
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.
Arguments ​
$type
(string) – The component class that should be used as the fallback
Returns ​
getPlaceholderHtml()
​
- Since
- 3.0.6
Displays an error message (and possibly a plugin install button) in place of the normal component UI.