-
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
- Widgets
- Form
Backend\Widgets\Form
Overview
Form Widget is used for building back end forms and renders a form
Extends
Implements
- October\Contracts\Element\FormElement
Public Properties
public array $fields
fields configuration.
public array $tabs
tabs (primary) configuration.
public array $secondaryTabs
secondaryTabs configuration.
public Model $model
model object for the form.
public array $data
data containing field values, if none supplied, model is used.
public string $context
context of this form, fields that do not belong to this context will not be shown.
public string $arrayName
arrayName if the field element names should be contained in an array.
Eg: <input name="nameArray[fieldName]" />
public bool $isNested
isNested is used to flag that this form is being rendered as part of another form, a good indicator to expect that the form model and dataset values will differ.
public bool $useModelFields
useModelFields requests form fields from the supplied model.
public string $sessionKey
sessionKey for the active session, used for editing forms and deferred bindings.
public string $sessionKeySuffix
sessionKeySuffix adds some extra uniqueness to the session key.
public string|null $parentFieldName
parentFieldName if this form is nested in a field.
public bool $previewMode
previewMode renders this form with uneditable preview data.
public bool $surveyMode
surveyMode renders this form using a survey layout (no tabs)
public bool $horizontalMode
horizontalMode renders this form using a horizontal layout
Show inherited public properties
Inherited Public Properties
- $config - supplied. (defined in Backend\Classes\WidgetBase)
- $alias - defined for this widget. (defined in Backend\Classes\WidgetBase)
- $implement - extensions for this class. (defined in October\Rain\Extension\Extendable)
- $vars - is a list of variables to pass to the page. (defined in Backend\Classes\WidgetBase)
- $layout - to use for the view. (defined in Backend\Classes\WidgetBase)
- $suppressLayout - prevents the use of a layout. (defined in Backend\Classes\WidgetBase)
- $assetPath - specifies the relative path to the asset directory. (defined in Backend\Classes\WidgetBase)
- $assetUrlPath - specifies the public path to the asset directory. (defined in Backend\Classes\WidgetBase)
Protected Properties
protected $defaultAlias
defaultAlias to identify this widget.
protected boolean $fieldsDefined
fieldsDefined determines if field definitions have been created.
protected array $allFields
allFields used in this form.
See Also
protected object $allTabs
allTabs sections used in this form.
See Also
protected array $saveDataOverride
saveDataOverride allows for values to be changed during the save process
protected FieldsetDefinition|null $activeTabSection
activeTabSection where fields are currently being added
protected array $formWidgets
formWidgets collection of all form widgets used in this form.
protected Backend\Classes\WidgetManager $widgetManager
protected array $modelsToSave
modelsToSave are models that require saving
Show inherited protected properties
Inherited Protected Properties
- $controller - for the backend. (defined in Backend\Classes\WidgetBase)
- $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)
- $viewPath - specifies a path to the views directory. (defined in Backend\Classes\WidgetBase)
- $layoutPath - specifies a path to the layout directory. (defined in Backend\Classes\WidgetBase)
- $viewPathGuessCache - remembers path guesses for performance. (defined in Backend\Classes\WidgetBase)
- $assets - Collection of assets to display in the layout. (defined in Backend\Classes\WidgetBase)
- $assetBundles - Collection of combined and prioritized assets. (defined in Backend\Classes\WidgetBase)
- $assetDefaults - is the default attributes for assets. (defined in Backend\Classes\WidgetBase)
- $configPath - specifies a path to the config directory. (defined in Backend\Classes\WidgetBase)
- $emitterSingleEventCollection - of events to be fired once only. (defined in Backend\Classes\WidgetBase)
- $emitterEventCollection - of all registered events. (defined in Backend\Classes\WidgetBase)
- $emitterEventSorted - collection. (defined in Backend\Classes\WidgetBase)
- $fatalError - stores the object used for a fatal error. (defined in Backend\Classes\WidgetBase)
Public Methods
public addField()
public addField($name, $config = ]): [Backend\Classes\FormField
public addFields()
public addFields( array $fields, string $addToArea = null ): October\Rain\Element\ElementHolder
addFields programmatically, used internally and for extensibility
public addFormField()
public addFormField( $fieldName = null, $label = null ): October\Rain\Element\Form\FieldDefinition
addFormField adds a field to the fieldset
public addSecondaryTabField()
public addSecondaryTabField($name, $config = ]): [Backend\Classes\FormField
public addSecondaryTabFields()
public addSecondaryTabFields($fields): October\Rain\Element\ElementHolder
public addTabField()
public addTabField($name, $config = ]): [Backend\Classes\FormField
public addTabFields()
public addTabFields($fields): October\Rain\Element\ElementHolder
public bindToController()
public bindToController(): void
bindToController ensure fields are defined and form widgets are registered so they can also be bound to the controller this allows their AJAX features to operate.
public getContext()
public getContext(): string
getContext returns the active context for displaying the form.
public getField()
public getField($field): void
getField object specified
public getFields()
public getFields(): array
getFields for the instance
public getFormContext()
public getFormContext(): void
getFormContext returns the current form context
public getFormFieldset()
public getFormFieldset(): October\Rain\Element\Form\FieldsetDefinition
getFormFieldset returns the current fieldset definition
public getFormWidget()
public getFormWidget(string $field): void
getFormWidget returns a specified form widget
public getFormWidgets()
public getFormWidgets(): array
getFormWidgets for the instance
public getModel()
public getModel(): Model|null
getModel returns the active model for this form.
public getSaveData()
public getSaveData(): array
getSaveData returns post data from a submitted form.
public getSessionKey()
public getSessionKey(): string
getSessionKey returns the active session key.
public getSessionKeyWithSuffix()
public getSessionKeyWithSuffix(): string
public getTab()
public getTab(string $field): mixed
Get a specified tab object. Options: outside, primary, secondary.
public getTabs()
public getTabs(): object[FormTabs]
getTabs for the instance
public init()
public init(): void
init the widget, called by the constructor and free from its parameters.
public nameToId()
public nameToId($input $input): string
nameToId is a helper method to convert a field name to a valid ID attribute
public onLazyLoadTab()
public onLazyLoadTab(): void
onLazyLoadTab renders all fields of a tab in the target tab pane
public onRefresh()
public onRefresh(): array
onRefresh event handler for refreshing the form.
public removeField()
public removeField($name): bool
removeField programmatically
public removeTab()
public removeTab(string $name): void
removeTab programmatically remove all fields belonging to a tab
public render()
public render(array $options = []): string|bool
render the widget.
Options:
- preview: Render this form as an uneditable preview. Default: false
- useContainer: Wrap the result in a container, used by AJAX. Default: true
- section: Which form section to render. Default: null
- outside: Renders the Outside Fields section.
- primary: Renders the Primary Tabs section.
- secondary: Renders the Secondary Tabs section.
- null: Renders all sections
public renderField()
public renderField( Backend\Classes\FormField|string $field, array $options = [] ): string|bool
renderField renders a single form field
Options:
- useContainer: Wrap the result in a container, used by AJAX. Default: true
public renderFieldElement()
public renderFieldElement( Backend\Classes\FormField|string $field ): string|bool
renderFieldElement renders the HTML element for a field
public renderFields()
public renderFields($fields): string
renderFields renders the specified fields.
public renderTab()
public renderTab($tabName, $options = []): void
renderField
public renderTabSection()
public renderTabSection($tabs): string
renderTabSection renders the specified tabs.
public setFormValues()
public setFormValues(array $data = null): array
setFormValues sets or resets form field values.
public setSaveDataOverride()
public setSaveDataOverride($key, $value): void
setSaveDataOverride will override the save data captured by the form
Inherited Public Methods
- __call() - calls an undefined local method. (defined in October\Rain\Extension\Extendable)
- __callStatic() - calls an undefined static method. (defined in October\Rain\Extension\Extendable)
- __construct() - the widget. (defined in Backend\Classes\WidgetBase)
- __get() - an undefined property. (defined in October\Rain\Extension\Extendable)
- __set() - an undefined property. (defined in October\Rain\Extension\Extendable)
- __sleep() - prepare the object for serialization. (defined in October\Rain\Extension\Extendable)
- __wakeup() - when a model is being unserialized, check if it needs to be booted. (defined in October\Rain\Extension\Extendable)
- addCss() - includes a StyleSheet asset to the asset list. (defined in Backend\Classes\WidgetBase)
- addCssBundle() - includes a CSS asset to the bundled combiner pipeline. (defined in Backend\Classes\WidgetBase)
- 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)
- addJs() - includes a JavaScript asset to the asset list. (defined in Backend\Classes\WidgetBase)
- addJsBundle() - includes a JS asset to the bundled combiner pipeline. (defined in Backend\Classes\WidgetBase)
- addRss() - adds an RSS link asset to the asset list. Call $this->makeAssets(). (defined in Backend\Classes\WidgetBase)
- addViewPath() - prepends a path on the available view path locations. (defined in Backend\Classes\WidgetBase)
- asExtension() - is short hand for
getClassExtension()
method, except takes the short. (defined in October\Rain\Extension\Extendable) - bindEvent() - creates a new event binding. (defined in Backend\Classes\WidgetBase)
- bindEventOnce() - creates a new event binding that fires once only. (defined in Backend\Classes\WidgetBase)
- clearExtendedClasses() - (defined in October\Rain\Extension\Extendable)
- combineAssets() - runs asset paths through the Asset Combiner. (defined in Backend\Classes\WidgetBase)
- 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) - fireEvent() - and call the listeners. (defined in Backend\Classes\WidgetBase)
- fireSystemEvent() - fires a combination of local and global events. The first segment is removed. (defined in Backend\Classes\WidgetBase)
- fireViewEvent() - is a special event function used for extending within view files, (defined in Backend\Classes\WidgetBase)
- flushAssets() - disables the use, and subsequent broadcast, of assets. This is useful. (defined in Backend\Classes\WidgetBase)
- getAssetPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\WidgetBase)
- getAssetPaths() - returns an array of all registered asset paths. (defined in Backend\Classes\WidgetBase)
- 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() - is a safe accessor for configuration values. (defined in Backend\Classes\WidgetBase)
- getConfigPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\WidgetBase)
- getController() - returns the controller using this widget. (defined in Backend\Classes\WidgetBase)
- getDynamicProperties() - returns all dynamic properties and their values. (defined in October\Rain\Extension\Extendable)
- getEventHandler() - returns a fully qualified event handler name for this widget. (defined in Backend\Classes\WidgetBase)
- getFatalError() - returns error message. (defined in Backend\Classes\WidgetBase)
- getId() - returns a unique ID for this widget. Useful in creating HTML markup. (defined in Backend\Classes\WidgetBase)
- getViewPath() - locates a file based on its definition. The file name can be prefixed. (defined in Backend\Classes\WidgetBase)
- getViewPaths() - returns the active view path locations. (defined in Backend\Classes\WidgetBase)
- getWidget() - (defined in Backend\Classes\WidgetBase)
- guessConfigPath() - guesses the package path for the called class. (defined in Backend\Classes\WidgetBase)
- guessConfigPathFrom() - guesses the package path from a specified class. (defined in Backend\Classes\WidgetBase)
- guessViewPath() - guesses the package path for the called class. (defined in Backend\Classes\WidgetBase)
- guessViewPathFrom() - guesses the package path from a specified class, including. (defined in Backend\Classes\WidgetBase)
- handleError() - sets standard page variables in the case of a controller error. (defined in Backend\Classes\WidgetBase)
- hasAssetsDefined() - returns true if assets any have been added. (defined in Backend\Classes\WidgetBase)
- hasFatalError() - returns true if a fatal error has been set. (defined in Backend\Classes\WidgetBase)
- 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)
- makeAssets() - outputs
<link>
and<script>
tags to load assets previously added with addJs and addCss method calls. (defined in Backend\Classes\WidgetBase) - makeConfig() - reads the contents of the supplied file and applies it to this object. (defined in Backend\Classes\WidgetBase)
- makeConfigFromArray() - makes a config object from an array, making the first. (defined in Backend\Classes\WidgetBase)
- makeFileContents() - includes a file path using output buffering. (defined in Backend\Classes\WidgetBase)
- makeFormWidget() - object with the supplied form field and widget configuration. (defined in Backend\Classes\WidgetBase)
- makeLayout() - renders a layout. (defined in Backend\Classes\WidgetBase)
- makeLayoutPartial() - renders a layout partial. (defined in Backend\Classes\WidgetBase)
- makePartial() - renders a partial file contents located in the views folder. (defined in Backend\Classes\WidgetBase)
- makeView() - loads a view with the name specified. Applies layout if its name is provided. (defined in Backend\Classes\WidgetBase)
- makeViewContent() - renders supplied contents inside a layout. (defined in Backend\Classes\WidgetBase)
- makeWidget() - object with the supplied configuration file. (defined in Backend\Classes\WidgetBase)
- mergeConfig() - merges two configuration sources, either prepared or not, and returns. (defined in Backend\Classes\WidgetBase)
- methodExists() - checks if a method exists, extension equivalent of method_exists(). (defined in October\Rain\Extension\Extendable)
- propertyExists() - checks if a property exists, extension equivalent of
property_exists()
. (defined in October\Rain\Extension\Extendable) - resetSession() - Resets all session data related to this widget. (defined in Backend\Classes\WidgetBase)
- unbindEvent() - destroys an event binding. (defined in Backend\Classes\WidgetBase)
Protected Methods
protected addFieldsFromModel()
protected addFieldsFromModel($addToArea = null): void
addFieldsFromModel from the model
protected applyFiltersFromModel()
protected applyFiltersFromModel($applyData = null): void
applyFiltersFromModel allows the model to filter fields
protected cleanSaveDataInternal()
protected cleanSaveDataInternal($data): array
cleanSaveDataInternal will purge disabled and hidden fields from the dataset
protected dataArrayForget()
protected dataArrayForget(array &$array, array $parts): void
Variant to array_forget() but preserves dots in key names.
protected dataArrayGet()
protected dataArrayGet( array $array, array $parts, null $default = null ): mixed
Variant to array_get() but preserves dots in key names.
protected dataArraySet()
protected dataArraySet( array &$array, array $parts, string $value ): array
Variant to array_set() but preserves dots in key names.
protected deferPurgedSaveAttributes()
protected deferPurgedSaveAttributes( October\Rain\Database\Model $model, array $attributesToPurge ): void
deferPurgedSaveAttributes removes an array of attributes from the model. If the model implements the Purgeable trait, this is preferred over the internal logic.
protected defineFormFields()
protected defineFormFields(): void
defineFormFields creates a flat array of form fields from the configuration and slots fields in to their respective tabs
protected evalFieldName()
protected evalFieldName($field): array
evalFieldName parses a field's name for embedded context with a result of fieldName@context to [fieldName, context]
protected getFieldDepends()
protected getFieldDepends(Backend\Classes\FormField $field): string
getFieldDepends returns a HTML encoded value containing the other fields this field depends on
protected getFieldValue()
protected getFieldValue(mixed $field, mixed $data = null): string
getFieldValue looks up the field value.
protected getSaveDataInternal()
protected getSaveDataInternal(): array
getSaveDataInternal will return all possible data to save
protected getSaveDataSourceInternal()
protected getSaveDataSourceInternal(): array
protected hasFieldValue()
protected hasFieldValue($field, $data = null): bool
hasFieldValue determines if the field value is found in the data.
protected initFormTabs()
protected initFormTabs(): void
protected initFormWidgetsConcern()
protected initFormWidgetsConcern(): void
protected isFormWidget()
protected isFormWidget($fieldType): bool
isFormWidget checks if a field type is a widget or not
protected loadAssets()
protected loadAssets(): void
loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.
protected makeFormField()
protected makeFormField($name, $config = ]): [Backend\Classes\FormField
makeFormField creates a form field object from name and configuration
protected makeFormFieldWidget()
protected makeFormFieldWidget($field): Backend\Classes\FormWidgetBase|null
makeFormFieldWidget object from a form field object
protected performSaveOnModel()
protected performSaveOnModel($model, $data, $options = null): void
performSaveOnModel saves complex data against a model inside a database transaction.
protected prepareModelsToSave()
protected prepareModelsToSave( October\Rain\Database\Model $model, array $saveData ): array
prepareModelsToSave takes a model and fills it with data from a multidimensional array. If an attribute is found to be a relationship, that relationship is also filled.
$modelsToSave = $this->prepareModelsToSave($model, [...]); foreach ($modelsToSave as $modelToSave) { $modelToSave->save(); }
protected prepareVars()
protected prepareVars(): void
prepareVars prepares the form data
protected processAutoOrder()
protected processAutoOrder($tabs): void
processAutoOrder applies a default sort order to all fields
protected processAutoSpan()
protected processAutoSpan($tabs): void
processAutoSpan converts fields with a span set to 'auto' as either 'left' or 'right' depending on the previous field.
protected processFieldOptionValues()
protected processFieldOptionValues($fields): void
processFieldOptionValues sets the callback for retrieving options from fields that specifically require it
protected processFormWidgetFields()
protected processFormWidgetFields($fields): void
processFormWidgetFields will mutate fields types that are registered as widgets, convert their type to 'widget' and internally allocate the widget object
protected processPermissionCheck()
protected processPermissionCheck($fields): void
processPermissionCheck check if user has permissions to show the field and removes it if permission is denied
protected processRequiredAttributes()
protected processRequiredAttributes($fields): void
processRequiredAttributes will set the required flag based on the model preference
protected processTranslatableAttributes()
protected processTranslatableAttributes($fields): void
processTranslatableAttributes will set the translatable flag based on the model preference
protected processValidationAttributes()
protected processValidationAttributes($fields): void
processValidationAttributes applies the field name to the validation engine
protected setFormValuesInternal()
protected setFormValuesInternal(array $data = null): array
setFormValuesInternal method delays resetting form widgets
protected setModelAttributes()
protected setModelAttributes( October\Rain\Database\Model $model, array $saveData, $attrName = '' ): void
setModelAttributes sets a data collection to a model attributes, relations are also set.
protected showFieldLabels()
protected showFieldLabels($field): bool
showFieldLabels is a helper method to determine if field should be rendered with label and comments.
protected useDefaultValues()
protected useDefaultValues(): bool
useDefaultValues determines when to apply default data, usually when the context is "create", the model is non-existent or the form is nested.
protected validateModel()
protected validateModel(): mixed
validateModel validates the supplied form model.
Show inherited protected methods
Inherited Protected Methods
- combineBundledAssets() - spins over every bundle definition and combines them to an asset. (defined in Backend\Classes\WidgetBase)
- emitterEventSortEvents() - sorts the listeners for a given event by priority. (defined in Backend\Classes\WidgetBase)
- 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)
- fillFromConfig() - transfers config values stored inside the $config property directly. (defined in Backend\Classes\WidgetBase)
- getAssetEntryBuildPath() - Internal helper, attaches a build code to an asset path. (defined in Backend\Classes\WidgetBase)
- getAssetScheme() - is an internal helper to get the asset scheme. (defined in Backend\Classes\WidgetBase)
- getConfigValueFrom() - will apply the config getter convention. (defined in Backend\Classes\WidgetBase)
- getExtendableMethodFromDynamicMethods() - (defined in October\Rain\Extension\Extendable)
- getExtendableMethodFromExtensions() - (defined in October\Rain\Extension\Extendable)
- getLocalPath() - converts a relative path to a local path. (defined in Backend\Classes\WidgetBase)
- getSession() - Retrieves a widget related key/value pair from session data. (defined in Backend\Classes\WidgetBase)
- handleViewException() - handles a view exception. (defined in Backend\Classes\WidgetBase)
- makeSessionId() - Returns a unique session identifier for this widget and controller action. (defined in Backend\Classes\WidgetBase)
- processAssetAttributes() - (defined in Backend\Classes\WidgetBase)
- putSession() - Saves a widget related key/value pair in to session data. (defined in Backend\Classes\WidgetBase)
- removeDuplicateAssets() - removes duplicate and global assets from the entire collection. (defined in Backend\Classes\WidgetBase)
- renderAssetAttributes() - takes an asset definition and returns the necessary HTML output. (defined in Backend\Classes\WidgetBase)