Craft 3 Class Reference

Class craft\behaviors\FieldLayoutBehavior

Inheritance
craft\behaviors\FieldLayoutBehavior » yii\base\Behavior » yii\base\BaseObject
Implements
yii\base\Configurable
Available since version
3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/behaviors/FieldLayoutBehavior.php

Field Layout behavior.

Public Properties
Property Type Description Defined By
$elementType string, null The element type that the field layout will be associated with craft\behaviors\FieldLayoutBehavior
$idAttribute string, null The attribute on the owner that holds the field layout ID craft\behaviors\FieldLayoutBehavior
$owner yii\base\Component, null The owner of this behavior yii\base\Behavior
Public Methods
Method Description Defined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__unset() Sets an object property to null. yii\base\BaseObject
attach() Attaches the behavior object to the component. yii\base\Behavior
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
detach() Detaches the behavior object from the component. yii\base\Behavior
events() Declares event handlers for the $owner's events. yii\base\Behavior
getFieldLayout() Returns the owner's field layout. craft\behaviors\FieldLayoutBehavior
getFieldLayoutId() Returns the owner's field layout ID. craft\behaviors\FieldLayoutBehavior
getFields() Returns the fields associated with the owner's field layout. craft\behaviors\FieldLayoutBehavior
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. craft\behaviors\FieldLayoutBehavior
setFieldLayout() Sets the owner's field layout. craft\behaviors\FieldLayoutBehavior
setFieldLayoutId() Sets the owner's field layout ID. craft\behaviors\FieldLayoutBehavior
setFields() Sets the fields associated with the owner's field layout craft\behaviors\FieldLayoutBehavior

Property Details

$elementType public property #

The element type that the field layout will be associated with

public string, null $elementType null

$idAttribute public property #

The attribute on the owner that holds the field layout ID

public string, null $idAttribute null

Method Details

getFieldLayout() public method #

Returns the owner's field layout.

public craft\models\FieldLayout getFieldLayout ( )
throws yii\base\InvalidConfigException if the configured field layout ID is invalid

getFieldLayoutId() public method #

Returns the owner's field layout ID.

public integer getFieldLayoutId ( )
throws yii\base\InvalidConfigException if the field layout ID could not be determined

getFields() public method #

Returns the fields associated with the owner's field layout.

public craft\base\FieldInterface[] getFields ( )

init() public method #

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )
throws yii\base\InvalidConfigException if the behavior was not configured properly

setFieldLayout() public method #

Sets the owner's field layout.

public void setFieldLayout ( craft\models\FieldLayout $fieldLayout )
$fieldLayout craft\models\FieldLayout

setFieldLayoutId() public method #

Sets the owner's field layout ID.

public void setFieldLayoutId ( $id )
$id integer, string, callable

setFields() public method #

Sets the fields associated with the owner's field layout

public void setFields ( array $fields )
$fields craft\base\FieldInterface[]