-
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
OctoberUtil
- ComposerScript
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- ProjectSet
- ProjectSync
- ThemeCheck
- ThemeInstall
- ThemeList
- ThemeRemove
- ThemeSync
- ThemeUse
-
-
Controllers
-
Database
-
Facades
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
resizer
-
router
-
template
-
theme
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
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
-
- afterBoot
- afterCreate
- afterDelete
- afterFetch
- afterRestore
- afterSave
- afterUpdate
- afterValidate
- beforeCreate
- beforeDelete
- beforeFetch
- beforeGetAttribute
- beforeRestore
- beforeSave
- beforeSetAttribute
- beforeUpdate
- beforeValidate
- getAttribute
- saveInternal
- setAttribute
-
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
resizer
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
- BaseCssFilter
- CallablesFilter
- CssCacheBustingFilter
- CssImportFilter
- CssMinFilter
- CssRewriteFilter
- FilterCollection
- JavascriptImporter
- JSMinFilter
- JSMinPlusFilter
- JSqueezeFilter
- LessCompiler
- LessphpFilter
- MinifyCssCompressorFilter
- PackagerFilter
- PackerFilter
- ScssCompiler
- ScssphpFilter
- StylesheetMinify
-
Util
- README
- AssetManager
- AssetWriter
- FilterManager
-
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Parsedown
-
Syntax
- Bracket
- Ini
- Markdown
- MarkdownData
- ParseServiceProvider
- Twig
- Yaml
-
-
Process
-
Resize
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Backend
- Classes
- FormField
Backend\Classes\FormField
FormField definition is a translation of the form field configuration
Public properties
public string $fieldName
Form field name.
public string $arrayName
If the field element names should be contained in an array. Eg:
<input name="nameArray[fieldName]" />
public string $idPrefix
A prefix to the field identifier so it can be totally unique.
public string $label
Form field label.
public string $value
Form field value.
public string $valueFrom
Model attribute to use for the display value.
public string $defaults
Specifies a default value for supported fields.
public string $defaultFrom
Model attribute to use for the default value.
public string $tab
Specifies if this field belongs to a tab.
public string $type
Display mode. Text, textarea
public string $options
Field options.
public string $span
Specifies a side. Possible values: auto, left, right, full.
public string $spanClass
spanClass is used by the row span type for a custom css class.
public string $size
Specifies a size. Possible values: tiny, small, large, huge, giant.
public string $context
Specifies contextual visibility of this form field.
public bool $required
Specifies if this field is mandatory.
public bool $readOnly
Specify if the field is read-only or not.
public bool $disabled
Specify if the field is disabled or not.
public bool $hidden
Specify if the field is hidden. Hiddens fields are not included in postbacks.
public bool $stretch
Specifies if this field stretch to fit the page height.
public string $comment
Specifies a comment to accompany the field
public string $commentPosition
Specifies the comment position.
public string $commentHtml
Specifies if the comment is in HTML format.
public string $placeholder
Specifies a message to display when there is no value supplied (placeholder).
public array $attributes
Contains a list of attributes specified in the field configuration.
public string $cssClass
Specifies a CSS class to attach to the field container.
public string $path
Specifies a path for partial-type fields.
public array $config
Raw field configuration.
public array $dependsOn
Other field names this field depends on, when the other fields are modified, this field will update.
public array $trigger
Other field names this field can be triggered by, see the Trigger API documentation.
public array $preset
Other field names text is converted in to a URL, slug or file name value in this field.
Public methods
public void __construct(string $fieldName, string $label)
Constructor.
Parameters
- string $fieldName - The name of the field
- string $label - The label of the field
public void attributes(array $items, string $position='field')
Sets the attributes for this field in a given position.
- field: Attributes are added to the form field element (input, select, textarea, etc)
- container: Attributes are added to the form field container (div.form-group)
Parameters
- array $items
- string $position
public void comment(string $text, string $position='below', bool $isHtml=NULL)
Adds a text comment above or below the field.
Parameters
- string $text - Specifies a comment text.
- string $position - Specifies a comment position.
- bool $isHtml - Set to true if you use HTML formatting in the comment Supported values are 'below' and 'above'
public void displayAs(string $type, array $config=array())
Specifies a field control rendering mode. Supported modes are:
- text - creates a text field. Default for varchar column types.
- textarea - creates a textarea control. Default for text column types.
- dropdown - creates a drop-down list. Default for reference-based columns.
- radio - creates a set of radio buttons.
- checkbox - creates a single checkbox.
- checkboxlist - creates a checkbox list.
- switch - creates a switch field.
Parameters
- string $type - Specifies a render mode as described above
- array $config - A list of render mode specific config.
public array getAttributes(string $position='field', $htmlBuild=true)
Returns the attributes for this field at a given position.
Parameters
- string $position
- $htmlBuild
public mixed getConfig(string $value, string $default=NULL)
Returns a raw config item value.
Parameters
- string $value
- string $default
public mixed getDefaultFromData(mixed $data)
Returns the default value for this field, the supplied data is used to source data when defaultFrom is specified.
Parameters
- mixed $data
public string getId(string $suffix=NULL)
Returns a value suitable for the field id property.
Parameters
- string $suffix - Specify a suffix string
public string getName(string $arrayName=NULL)
Returns a value suitable for the field name property.
Parameters
- string $arrayName - Specify a custom array name
public void getOptionsFromModel($model, $fieldOptions, $data)
getOptionsFromModel looks at the model for defined options.
Parameters
- $model
- $fieldOptions
- $data
public mixed getValueFromData(mixed $data, mixed $default=NULL)
Returns this fields value from a supplied data set, which can be an array or a model or another generic collection.
Parameters
- mixed $data
- mixed $default
public bool hasAttribute(string $name, string $position='field')
Checks if the field has the supplied [unfiltered] attribute.
Parameters
- string $name
- string $position
public bool isSelected(string $value=true)
Determine if the provided value matches this field's value.
Parameters
- string $value
public self options(array $value=NULL)
Sets field options, for dropdowns, radio lists and checkbox lists.
Parameters
- array $value
public array resolveModelAttribute(string $attribute, $attribute=NULL)
resolveModelAttribute returns the final model and attribute name of a nested attribute. Eg:
[$model, $attribute] = $this->resolveAttribute('person[phone]');
Parameters
- string $attribute - .
- $attribute
public void size(string $value='large')
Sets a side of the field on a form.
Parameters
- string $value - Specifies a size. Possible values: tiny, small, large, huge, giant
public void span(string $value='full', $spanClass='')
Sets a side of the field on a form.
Parameters
- string $value - Specifies a side. Possible values: left, right, full
- $spanClass
public void tab($value)
If this field belongs to a tab.
Parameters
- $value
Protected methods
protected array evalConfig(array $config)
Process options and apply them to this object.
Parameters
- array $config
protected array filterAttributes(array $attributes, string $position='field')
Adds any circumstantial attributes to the field based on other settings, such as the 'disabled' option.
Parameters
- array $attributes
- string $position
protected array filterPresetAttributes(array $attributes, string $position='field')
Adds attributes used specifically by the Input Preset API
Parameters
- array $attributes
- string $position
protected array filterTriggerAttributes(array $attributes, string $position='field')
Adds attributes used specifically by the Trigger API
Parameters
- array $attributes
- string $position
protected mixed getFieldNameFromData(string $fieldName, mixed $data, mixed $default=NULL)
Internal method to extract the value of a field name from a data set.
Parameters
- string $fieldName
- mixed $data
- mixed $default
protected boolean objectMethodExists(object $object, string $method)
Internal helper for method existence checks.
Parameters
- object $object
- string $method
protected void resolveModelAttributeInternal($model, $attribute=NULL, $objectOnly=false)
resolveModelAttributeInternal is an internal method resolver for resolveModelAttribute
Parameters
- $model
- $attribute
- $objectOnly