FieldsVariable
- Type
- Class
- Namespace
- Craft
- Inherits
- Craft\FieldsVariable
- Since
- 1.0
Class FieldsVariable
See also http://craftcms.com
View source (opens new window)
# Public Methods
| Method | Description |
|---|---|
| getAllFieldTypes() | Returns all installed fieldtypes. |
| getAllFields() | Returns all fields. |
| getAllGroups() | Returns all field groups. |
| getFieldByHandle() | Returns a field by its handle. |
| getFieldById() | Returns a field by its ID. |
| getFieldType() | Gets a fieldtype. |
| getFieldsByGroupId() | Returns all the fields in a given group. |
| getGroupById() | Returns a field group by its ID. |
| getLayoutById() | Returns a field layout by its ID. |
| getLayoutByType() | Returns a field layout by its type. |
| populateFieldType() | Populates a fieldtype. |
# getAllFieldTypes()
Signature
public array getAllFieldTypes ( )
# getAllFields()
Returns all fields.
View source (opens new window)
Arguments
$indexBy(string (opens new window), null (opens new window))
Returns
Signature
public array getAllFields ( $indexBy = null )
# getAllGroups()
Returns all field groups.
View source (opens new window)
Arguments
$indexBy(string (opens new window), null (opens new window))
Returns
Signature
public array getAllGroups ( $indexBy = null )
# getFieldByHandle()
Returns a field by its handle.
View source (opens new window)
Arguments
$handle(string (opens new window))
Returns
Signature
public Craft\FieldModel, null getFieldByHandle ( $handle )
# getFieldById()
Returns a field by its ID.
View source (opens new window)
Arguments
$fieldId(integer (opens new window))
Returns
Signature
public Craft\FieldModel, null getFieldById ( $fieldId )
# getFieldType()
Gets a fieldtype.
View source (opens new window)
Arguments
$class(string (opens new window))
Returns
Signature
public Craft\FieldTypeVariable, null getFieldType ( $class )
# getFieldsByGroupId()
Returns all the fields in a given group.
View source (opens new window)
Arguments
$groupId(integer (opens new window))$indexBy(string (opens new window), null (opens new window))
Returns
Signature
public array getFieldsByGroupId ( $groupId, $indexBy = null )
# getGroupById()
Returns a field group by its ID.
View source (opens new window)
Arguments
$groupId(integer (opens new window))
Returns
Signature
public Craft\FieldGroupModel, null getGroupById ( $groupId )
# getLayoutById()
Returns a field layout by its ID.
View source (opens new window)
Arguments
$layoutId(integer (opens new window))
Returns
Signature
public Craft\FieldLayoutModel, null getLayoutById ( $layoutId )
# getLayoutByType()
Returns a field layout by its type.
View source (opens new window)
Arguments
$type(integer (opens new window))
Returns
Signature
public Craft\FieldLayoutModel, null getLayoutByType ( $type )
# populateFieldType()
Populates a fieldtype.
View source (opens new window)
Arguments
$field(Craft\FieldModel)$element(Craft\BaseElementModel, null (opens new window))
Returns
Signature
public Craft\BaseFieldType, null populateFieldType ( Craft\FieldModel $field, $element = null )
← FieldsService File →