-
Backend
-
Behaviors
-
FormController
-
ImportExportController
-
ListController
-
RelationController
- FormController
- ImportExportController
- ListController
- RelationController
- ReorderController
- UserPreferencesModel
-
-
Classes
-
Dashboard
-
NavigationManager
-
WidgetManager
- AuthManager
- BackendController
- Controller
- ControllerBehavior
- DashboardManager
- DashboardWidgetBase
- FilterScope
- FilterWidgetBase
- FormField
- FormTabs
- FormWidgetBase
- ListColumn
- LoginCustomization
- MainMenuItem
- NavigationManager
- ReportDataSourceBase
- ReportDataSourceManager
- ReportWidgetBase
- RoleManager
- RolePermission
- SettingsController
- SideMenuItem
- Skin
- StaticReportWidgetContainer
- VueComponentBase
- WidgetBase
- WidgetManager
- WildcardController
-
-
Controllers
-
Database
-
Facades
-
FilterWidgets
-
FormWidgets
-
Helpers
-
Models
-
BrandSetting
-
ExportModel
-
ImportModel
- AccessLog
- BrandSetting
- Dashboard
- EditorSetting
- ExportModel
- ImportModel
- Preference
- ReportDataCache
- User
- UserGroup
- UserPreference
- UserPreferenceModel
- UserRole
- UserThrottle
-
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
-
Filter
-
Form
-
Lists
-
Table
- Filter
- Form
- Lists
- ListStructure
- ReportContainer
- RoleImpersonator
- Search
- SiteSwitcher
- Table
- Toolbar
-
- ServiceProvider
-
-
Cms
-
Classes
-
Controller
-
EditorExtension
-
Layout
-
Page
-
Partial
-
Theme
- AjaxResponse
- Asset
- CmsCompoundObject
- CmsController
- CmsDemoTrafficDataGenerator
- CmsException
- CmsObject
- CmsObjectCache
- CmsObjectCollection
- CmsReportDataSource
- CmsStatusDataSource
- CodeBase
- CodeParser
- ComponentBase
- ComponentBehavior
- ComponentHelpers
- ComponentManager
- ComponentModuleBase
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- Meta
- Page
- PageCode
- PageManager
- Partial
- PartialCode
- PartialStack
- PartialWatcher
- Router
- Snippet
- SnippetManager
- Theme
- ThemeManager
- ThisVariable
- TrafficLogger
-
-
Components
-
Console
-
Controllers
-
Database
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- AjaxPartialTokenParser
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- GetAttrAdjuster
- GetAttrNode
- Loader
- MetaNode
- MetaTokenParser
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
Traits
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Helpers
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
PresetManager
-
SiteManager
-
UiManager
-
UpdateManager
- AppBase
- CombineAssets
- DependencyResolver
- DriverBehavior
- ErrorHandler
- MailManager
- ManifestCache
- MarkupExtensionItem
- MarkupManager
- ModelBehavior
- PagerElement
- PluginBase
- PluginManager
- PresetManager
- ProductDetail
- RateLimiter
- ResizeImageItem
- ResizeImages
- SettingsManager
- SettingsMenuItem
- SiteManager
- SystemController
- SystemReportDataSource
- UiElement
- UiManager
- UpdateManager
- VersionManager
-
-
Console
- ComposerScript
- OctoberAbout
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberOptimize
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- OctoberUtilCommands
- OctoberUtilPatches
- OctoberUtilRefitLang
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- PluginSeed
- PluginTest
- ProjectSync
-
Controllers
-
Database
-
Facades
-
Helpers
-
Middleware
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Tailor
-
Behaviors
-
Classes
-
Blueprint
-
BlueprintIndexer
-
EditorExtension
-
Relations
-
SchemaBuilder
-
Scopes
- Blueprint
- BlueprintCollection
- BlueprintErrorData
- BlueprintException
- BlueprintIndexer
- BlueprintModel
- BlueprintVerifier
- ComponentVariable
- ContentFieldBase
- EditorExtension
- FieldManager
- Fieldset
- NavigationItem
- PermissionItem
- RecordIndexer
- SchemaBuilder
- SchemaPruner
-
-
Components
-
Console
-
ContentFields
-
Controllers
-
Models
-
EntryRecord
-
GlobalRecord
-
RecordImport
- ContentSchema
- EntryRecord
- GlobalRecord
- NestedFormItem
- PreviewToken
- RecordExport
- RecordImport
- RepeaterItem
-
-
Traits
-
VueComponents
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
brand
-
files
-
filter
-
form
-
list
-
menu
-
page
-
roles
-
site
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
internalTrafficStatistics
-
object
-
page
-
pageLookup
-
resizer
-
router
-
sitePicker
-
template
-
theme
- extendTwig
-
-
deferredBinding
-
editor
-
extension
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
filter
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
-
/docs/api/model/afterboot
-
/docs/api/model/aftercreate
-
/docs/api/model/afterdelete
-
/docs/api/model/afterfetch
-
/docs/api/model/afterinit
- afterRelation
- afterRestore
-
/docs/api/model/aftersave
- afterTrash
-
/docs/api/model/afterupdate
- afterValidate
-
/docs/api/model/beforecreate
-
/docs/api/model/beforedelete
-
/docs/api/model/beforefetch
- beforeGetAttribute
- beforeRelation
- beforeReplicate
- beforeRestore
-
/docs/api/model/beforesave
- beforeSetAttribute
-
/docs/api/model/beforeupdate
- beforeValidate
- extendBlueprint
- getAttribute
- newInstance
- saveInternal
- setAttribute
-
-
pages
-
snippet
-
-
site
-
system
-
assets
- beforeAddAsset
-
/docs/api/system/assets/beforebundleasset
-
console
-
mirror
-
-
mail
-
reportwidgets
-
resizer
-
settings
-
site
-
updater
- extendConfigFile
- extendTwig
-
-
tailor
-
user
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
-
Traits
-
Util
- README
- AsseticServiceProvider
- AssetManager
- AssetWriter
- Combiner
- FilterManager
-
-
Auth
-
Combine
-
Composer
-
Config
-
Database
-
Attach
-
Concerns
-
Connections
-
Connectors
-
Factories
-
Models
-
Relations
-
Schema
-
Scopes
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- Dongle
- ExpandoModel
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- Replicator
- SortableScope
- TreeCollection
- Updater
-
-
Element
-
Filter
-
Form
-
Lists
-
Navigation
- ElementBase
- ElementHolder
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
-
-
Halcyon
-
Concerns
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Resize
-
Router
-
Scaffold
-
Support
-
Debug
-
Facades
-
Traits
- README
- Arr
- ClassLoader
- Collection
- Facade
- ModuleServiceProvider
- SafeCollection
- ServiceProvider
- Singleton
- Str
-
-
Translation
-
Validation
-
- Documentation
- API
- Backend
- Classes
- FormField
Backend\Classes\FormField
Overview
FormField definition is a translation of the form field configuration
Extends
- October\Rain\Element\Form\FieldDefinition
- October\Rain\Element\ElementBase
- October\Rain\Extension\Extendable
Implements
- Illuminate\Contracts\Support\Arrayable
- ArrayAccess
- Illuminate\Contracts\Support\Jsonable
- JsonSerializable
Public Properties
There are no public properties in the class.
Show inherited public properties
Inherited Public Properties
- $config - values for this instance. (defined in October\Rain\Element\ElementBase)
- $implement - extensions for this class. (defined in October\Rain\Extension\Extendable)
Protected Properties
There are no protected properties in the class.
Show inherited protected properties
Inherited Protected Properties
- $optionsCallback - (defined in October\Rain\Element\Form\FieldDefinition)
- $extensionData - contains class reflection information, including behaviors. (defined in October\Rain\Extension\Extendable)
- $extendableStaticMethods - is a collection of static methods used by behaviors. (defined in October\Rain\Extension\Extendable)
- $extendableGuardProperties - indicates if dynamic properties can be created. (defined in October\Rain\Extension\Extendable)
Public Methods
public __construct()
public __construct($config = [], $label = null): void
__construct using old and new interface
public getAttributes()
public getAttributes(string $position = 'field', $htmlBuild = true): array
getAttributes returns the attributes for this field at a given position.
public getDefaultFromData()
public getDefaultFromData(mixed $data): mixed
getDefaultFromData returns the default value for this field, the supplied data is used to source data when defaultFrom is specified.
public getDisplayValue()
public getDisplayValue($value): void
getDisplayValue checks to see if display values (model attributes) should be translated, and also escapes the value
public getId()
public getId(string $suffix = null): string
getId returns a value suitable for the field id property.
public getName()
public getName(string $arrayName = null): string
getName returns a value suitable for the field name property.
public getOptionsFromModel()
public getOptionsFromModel($model, $fieldOptions, $data): void
getOptionsFromModel looks at the model for defined options.
public getTranslatableMessage()
public getTranslatableMessage(): string
public getValueFromData()
public getValueFromData(mixed $data, mixed $default = null): mixed
getValueFromData returns this fields value from a supplied data set, which can be an array or a model or another generic collection.
public hasAttribute()
public hasAttribute(string $name, string $position = 'field'): bool
hasAttribute checks if the field has the supplied [unfiltered] attribute.
public isSelected()
public isSelected(string $value = true): bool
isSelected determines if the provided value matches this field's value.
public nearestModelAttribute()
public nearestModelAttribute($model, $attribute = null): void
nearestModelAttribute returns the nearest model and attribute name of a nested attribute, which is useful for checking if an attribute is jsonable or a relation.
public resolveModelAttribute()
public resolveModelAttribute(string $attribute, $attribute = null): array
resolveModelAttribute returns the final model and attribute name of a nested attribute. Eg:
[$model, $attribute] = $this->resolveAttribute('person[phone]');
Inherited Public Methods
- __call() - handles dynamic calls to the element instance to set config. (defined in October\Rain\Element\ElementBase)
- __callStatic() - calls an undefined static method. (defined in October\Rain\Extension\Extendable)
- __get() - dynamically retrieves the value of an attribute. (defined in October\Rain\Element\ElementBase)
- __isset() - dynamically checks if an attribute is set. (defined in October\Rain\Element\ElementBase)
- __set() - dynamically sets the value of an attribute. (defined in October\Rain\Element\ElementBase)
- __sleep() - prepare the object for serialization. (defined in October\Rain\Extension\Extendable)
- __unset() - dynamically unsets an attribute. (defined in October\Rain\Element\ElementBase)
- __wakeup() - when a model is being unserialized, check if it needs to be booted. (defined in October\Rain\Extension\Extendable)
- addDynamicMethod() - programmatically adds a method to the extendable class. (defined in October\Rain\Extension\Extendable)
- addDynamicProperty() - programmatically adds a property to the extendable class. (defined in October\Rain\Extension\Extendable)
- asExtension() - is short hand for
getClassExtension()
method, except takes the short. (defined in October\Rain\Extension\Extendable) - clearExtendedClasses() - (defined in October\Rain\Extension\Extendable)
- displayAs() - type for this field. (defined in October\Rain\Element\Form\FieldDefinition)
- evalConfig() - override method. (defined in October\Rain\Element\ElementBase)
- extend() - this class with a closure. (defined in October\Rain\Extension\Extendable)
- extendClassWith() - dynamically extends a class with a specified behavior. (defined in October\Rain\Extension\Extendable)
- extendableCall() - magic method for
__call()
. (defined in October\Rain\Extension\Extendable) - extendableCallStatic() - magic method for
__callStatic()
. (defined in October\Rain\Extension\Extendable) - extendableConstruct() - should be called as part of the constructor. (defined in October\Rain\Extension\Extendable)
- extendableDestruct() - should be called when serializing the object. (defined in October\Rain\Extension\Extendable)
- extendableExtendCallback() - is a helper method for
::extend()
static method. (defined in October\Rain\Extension\Extendable) - extendableGet() - magic method for
__get()
. (defined in October\Rain\Extension\Extendable) - extendableSet() - magic method for
__set()
. (defined in October\Rain\Extension\Extendable) - get() - an attribute from the element instance. (defined in October\Rain\Element\ElementBase)
- getClassExtension() - returns a behavior object from an extendable class, example:. (defined in October\Rain\Extension\Extendable)
- getClassMethodAsReflector() - (defined in October\Rain\Extension\Extendable)
- getClassMethods() - gets a list of class methods, extension equivalent of get_class_methods(). (defined in October\Rain\Extension\Extendable)
- getConfig() - returns the entire config array. (defined in October\Rain\Element\ElementBase)
- getDynamicProperties() - returns all dynamic properties and their values. (defined in October\Rain\Extension\Extendable)
- hasOptions() - returns true if options have been specified. (defined in October\Rain\Element\Form\FieldDefinition)
- implementClassWith() - will implement an extension using non-interference and should. (defined in October\Rain\Extension\Extendable)
- isClassExtendedWith() - checks if extendable class is extended with a behavior object. (defined in October\Rain\Extension\Extendable)
- isClassInstanceOf() - checks if the class implements the supplied interface methods. (defined in October\Rain\Extension\Extendable)
- jsonSerialize() - converts the object into something JSON serializable. (defined in October\Rain\Element\ElementBase)
- matchesContext() - returns true if the field matches the supplied context. (defined in October\Rain\Element\Form\FieldDefinition)
- methodExists() - checks if a method exists, extension equivalent of method_exists(). (defined in October\Rain\Extension\Extendable)
- offsetExists() - determines if the given offset exists. (defined in October\Rain\Element\ElementBase)
- offsetGet() - gets the value for a given offset. (defined in October\Rain\Element\ElementBase)
- offsetSet() - sets the value at the given offset. (defined in October\Rain\Element\ElementBase)
- offsetUnset() - unsets the value at the given offset. (defined in October\Rain\Element\ElementBase)
- options() - get/set for dropdowns, radio lists and checkbox lists. (defined in October\Rain\Element\Form\FieldDefinition)
- propertyExists() - checks if a property exists, extension equivalent of
property_exists()
. (defined in October\Rain\Extension\Extendable) - span() - sets a side of the field on a form. (defined in October\Rain\Element\Form\FieldDefinition)
- toArray() - converts the element instance to an array. (defined in October\Rain\Element\ElementBase)
- toJson() - converts the element instance to JSON. (defined in October\Rain\Element\ElementBase)
- useConfig() - (defined in October\Rain\Element\Form\FieldDefinition)
Protected Methods
protected filterAttributes()
protected filterAttributes( array $attributes, string $position = 'field' ): array
filterAttributes adds any circumstantial attributes to the field based on other settings, such as the 'disabled' option.
protected filterPresetAttributes()
protected filterPresetAttributes( array $attributes, string $position = 'field' ): array
filterPresetAttributes adds attributes used specifically by the Input Preset API
protected filterTriggerAttributes()
protected filterTriggerAttributes( array $attributes, string $position = 'field' ): array
filterTriggerAttributes adds attributes used specifically by the Trigger API
protected getFieldNameFromData()
protected getFieldNameFromData( string $fieldName, mixed $data, mixed $default = null ): mixed
getFieldNameFromData is an internal method to extract the value of a field name from a data set.
protected getOptionsFromModelAsDefault()
protected getOptionsFromModelAsDefault($model, $data): void
getOptionsFromModelAsDefault refers to the model method or any of its behaviors
protected getOptionsFromModelAsString()
protected getOptionsFromModelAsString($model, $methodName, $data): void
getOptionsFromModelAsString where options are an explicit method reference
protected initDefaultValues()
protected initDefaultValues(): void
initDefaultValues for this field
protected objectMethodExists()
protected objectMethodExists(object $object, string $method): boolean
objectMethodExists is an internal helper for method existence checks.
protected resolveModelAttributeInternal()
protected resolveModelAttributeInternal( $model, $attribute = null, $options = [] ): void
resolveModelAttributeInternal is an internal method resolver for resolveModelAttribute
Show inherited protected methods
Inherited Protected Methods
- extendableIsAccessible() - checks if a property is accessible, property equivalent. (defined in October\Rain\Extension\Extendable)
- extendableIsSettingDynamicProperty() - returns true if a dynamic. (defined in October\Rain\Extension\Extendable)
- extensionExtractImplements() - will return classes to implement. (defined in October\Rain\Extension\Extendable)
- extensionExtractMethods() - extracts the available methods from a behavior and adds it. (defined in October\Rain\Extension\Extendable)
- getExtendableMethodFromDynamicMethods() - (defined in October\Rain\Extension\Extendable)
- getExtendableMethodFromExtensions() - (defined in October\Rain\Extension\Extendable)