FieldLayoutBehavior

Type
Class
Namespace
craft\behaviors
Inherits
craft\behaviors\FieldLayoutBehavior » yii\base\Behavior » yii\base\BaseObject
Implements
yii\base\Configurable
Since
3.0

Field Layout behavior.

View source

Public Properties

PropertyDescription
$elementTypestring, null – The element type that the field layout will be associated with
$fieldLayoutcraft\models\FieldLayout
$fieldLayoutIdinteger
$fieldscraft\base\FieldInterface[]
$idAttributestring, null – The attribute on the owner that holds the field layout ID
$owneryii\base\Component, null – The owner of this behavior

$elementType

Type
string, null

The element type that the field layout will be associated with

View source

Signature

public string, null $elementType = null

$fieldLayout

Signature

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

$fieldLayoutId

Signature

public integer getFieldLayoutId ( )
public void setFieldLayoutId ( $id )

$fields

Signature

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

$idAttribute

Type
string, null

The attribute on the owner that holds the field layout ID

View source

Signature

public string, null $idAttribute = null

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
attach()Attaches the behavior object to the component.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
detach()Detaches the behavior object from the component.
events()Declares event handlers for the $owner's events.
getFieldLayout()Returns the owner's field layout.
getFieldLayoutId()Returns the owner's field layout ID.
getFields()Returns the fields associated with the owner's field layout.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()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.
setFields()Sets the fields associated with the owner's field layout

getFieldLayout()

Returns the owner's field layout.

View source

Returns

craft\models\FieldLayout

Throws

Signature

public craft\models\FieldLayout getFieldLayout ( )

getFieldLayoutId()

Returns the owner's field layout ID.

View source

Returns

integer

Throws

Signature

public integer getFieldLayoutId ( )

getFields()

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

View source

Returns

craft\base\FieldInterface[]

Signature

public craft\base\FieldInterface[] getFields ( )

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

Throws

Signature

public void init ( )

setFieldLayout()

Sets the owner's field layout.

View source

Arguments

Signature

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

setFieldLayoutId()

Sets the owner's field layout ID.

View source

Arguments

Signature

public void setFieldLayoutId ( $id )

setFields()

Sets the fields associated with the owner's field layout

View source

Arguments

Signature

public void setFields ( array $fields )