FieldLayoutBehavior
- Type
- Class
- Namespace
- craft\behaviors
- Inherits
- craft\behaviors\FieldLayoutBehavior » yii\base\Behavior (opens new window) » yii\base\BaseObject (opens new window)
- Implements
- yii\base\Configurable (opens new window)
- Since
- 3.0.0
Field Layout behavior.
View source (opens new window)
# Public Properties
Property | Description |
---|---|
customFields | craft\base\FieldInterface[] |
elementType | string (opens new window), null (opens new window) – The element type that the field layout will be associated with |
fieldLayout | craft\models\FieldLayout |
fieldLayoutId | integer (opens new window) |
idAttribute | string (opens new window), null (opens new window) – The attribute on the owner that holds the field layout ID |
owner | craft\base\ElementInterface, yii\base\Model (opens new window) |
# customFields
- Type
- craft\base\FieldInterface[]
- Default value
null
- Access
- Read-only
- Since
- 4.0.0
View source (opens new window)
# elementType
- Type
- string (opens new window), null (opens new window)
- Default value
null
The element type that the field layout will be associated with
View source (opens new window)
# fieldLayout
- Type
- craft\models\FieldLayout
- Default value
null
View source (opens new window)
# fieldLayoutId
- Type
- integer (opens new window)
- Default value
null
View source (opens new window)
# idAttribute
- Type
- string (opens new window), null (opens new window)
- Default value
null
The attribute on the owner that holds the field layout ID
View source (opens new window)
# owner
- Type
- craft\base\ElementInterface, yii\base\Model (opens new window)
- Default value
null
View source (opens new window)
# Public Methods
Method | Description |
---|---|
__call() (opens new window) | Calls the named method which is not a class method. |
__construct() (opens new window) | Constructor. |
__get() (opens new window) | Returns the value of an object property. |
__isset() (opens new window) | Checks if a property is set, i.e. defined and not null. |
__set() (opens new window) | Sets value of an object property. |
__unset() (opens new window) | Sets an object property to null. |
attach() (opens new window) | Attaches the behavior object to the component. |
canGetProperty() (opens new window) | Returns a value indicating whether a property can be read. |
canSetProperty() (opens new window) | Returns a value indicating whether a property can be set. |
className() (opens new window) | Returns the fully qualified name of this class. |
detach() (opens new window) | Detaches the behavior object from the component. |
events() (opens new window) | Declares event handlers for the owner (opens new window)'s events. |
getCustomFields() | Returns the custom fields associated with the owner's field layout. |
getFieldLayout() | Returns the owner's field layout. |
getFieldLayoutId() | Returns the owner's field layout ID. |
hasMethod() (opens new window) | Returns a value indicating whether a method is defined. |
hasProperty() (opens new window) | Returns a value indicating whether a property is defined. |
init() | Initializes the object. |
setFieldLayout() | Sets the owner's field layout. |
setFieldLayoutId() | Sets the owner's field layout ID. |
# getCustomFields()
- Since
- 4.0.0
Returns the custom fields associated with the owner's field layout.
View source (opens new window)
Returns
# getFieldLayout()
Returns the owner's field layout.
View source (opens new window)
Returns
Throws
- yii\base\InvalidConfigException (opens new window)
if the configured field layout ID is invalid
# getFieldLayoutId()
Returns the owner's field layout ID.
View source (opens new window)
Returns
Throws
- yii\base\InvalidConfigException (opens new window)
if the field layout ID could not be determined
# init()
Initializes the object.
This method is invoked at the end of the constructor after the object is initialized with the given configuration.
View source (opens new window)
Throws
- yii\base\InvalidConfigException (opens new window)
if the behavior was not configured properly
# setFieldLayout()
Sets the owner's field layout.
View source (opens new window)
Arguments
$fieldLayout
(craft\models\FieldLayout)
# setFieldLayoutId()
Sets the owner's field layout ID.
View source (opens new window)