FormHelper
Form's helper class.
Provides a storage for filesystem's paths where Form's entities reside and methods for creating those entities. Also stores objects with entities' prototypes for further reusing.
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
addFieldPath
Method to add a path to the list of field include paths.
addFieldPath(string|string[] new = null) : string||string|int
since |
1.7.0 |
---|
Arguments
- new
string|array<string|int, string>
A path or array of paths to add.
Response
array<string|int, string>
The list of paths that have been added.
addFieldPrefix
Method to add a namespace prefix to the list of field lookups.
addFieldPrefix(string|string[] new = null) : string||string|int
since |
3.8.0 |
---|
Arguments
- new
string|array<string|int, string>
A namespaces or array of namespaces to add.
Response
array<string|int, string>
The list of namespaces that have been added.
addFilterPath
Method to add a path to the list of filter include paths.
addFilterPath(string|string[] new = null) : string||string|int
since |
4.0.0 |
---|
Arguments
- new
string|array<string|int, string>
A path or array of paths to add.
Response
array<string|int, string>
The list of paths that have been added.
addFilterPrefix
Method to add a namespace to the list of filter lookups.
addFilterPrefix(string|string[] new = null) : string||string|int
since |
4.0.0 |
---|
Arguments
- new
string|array<string|int, string>
A namespace or array of namespaces to add.
Response
array<string|int, string>
The list of namespaces that have been added.
addFormPath
Method to add a path to the list of form include paths.
addFormPath(string|string[] new = null) : string||string|int
since |
1.7.0 |
---|
Arguments
- new
string|array<string|int, string>
A path or array of paths to add.
Response
array<string|int, string>
The list of paths that have been added.
addFormPrefix
Method to add a namespace to the list of form lookups.
addFormPrefix(string|string[] new = null) : string||string|int
since |
3.8.0 |
---|
Arguments
- new
string|array<string|int, string>
A namespace or array of namespaces to add.
Response
array<string|int, string>
The list of namespaces that have been added.
addPath
Method to add a path to the list of include paths for one of the form's entities.
addPath( entity, string|string[] new = null) : string||string|int
Currently supported entities: field, rule and form. You are free to support your own in a subclass.
since |
1.7.0 |
---|
Arguments
- entity
string
Form's entity name for which paths will be added.- new
string|array<string|int, string>
A path or array of paths to add.
Response
array<string|int, string>
The list of paths that have been added.
addPrefix
Method to add a namespace to the list of namespaces for one of the form's entities.
addPrefix( entity, string|string[] new = null) : string||string|int
Currently supported entities: field, rule and form. You are free to support your own in a subclass.
since |
3.8.0 |
---|
Arguments
- entity
string
Form's entity name for which paths will be added.- new
string|array<string|int, string>
A namespace or array of namespaces to add.
Response
array<string|int, string>
The list of namespaces that have been added.
addRulePath
Method to add a path to the list of rule include paths.
addRulePath(string|string[] new = null) : string||string|int
since |
1.7.0 |
---|
Arguments
- new
string|array<string|int, string>
A path or array of paths to add.
Response
array<string|int, string>
The list of paths that have been added.
addRulePrefix
Method to add a namespace to the list of rule lookups.
addRulePrefix(string|string[] new = null) : string||string|int
since |
3.8.0 |
---|
Arguments
- new
string|array<string|int, string>
A namespace or array of namespaces to add.
Response
array<string|int, string>
The list of namespaces that have been added.
loadClass
Load a class for one of the form's entities of a particular type.
loadClass( entity, type) : string|bool
Currently, it makes sense to use this method for the "field" and "rule" entities (but you can support more entities in your subclass).
since |
1.7.0 |
---|
Arguments
- entity
string
One of the form entities (field or rule).- type
string
Type of an entity.
Response
string|bool
Class name on success or false otherwise.
loadFieldClass
Attempt to import the FormField class file if it isn't already imported.
loadFieldClass( type) : string|bool
You can use this method outside of Form for loading a field for inheritance or composition.
since |
1.7.0 |
---|
Arguments
- type
string
Type of a field whose class should be loaded.
Response
string|bool
Class name on success or false otherwise.
loadFieldType
Method to load a form field object given a type.
loadFieldType( type, new = true) : \Joomla\CMS\Form\FormField|bool
since |
1.7.0 |
---|
Arguments
- type
string
The field type.- new
bool
Flag to toggle whether we should get a new instance of the object.
Response
FormField|bool
FormField object on success, false otherwise.
loadFilterClass
Attempt to import the FormFilter class file if it isn't already imported.
loadFilterClass( type) : string|bool
You can use this method outside of Form for loading a filter for inheritance or composition.
since |
4.0.0 |
---|
Arguments
- type
string
Type of a filter whose class should be loaded.
Response
string|bool
Class name on success or false otherwise.
loadFilterType
Method to load a form filter object given a type.
loadFilterType( type, new = true) : \Joomla\CMS\Form\FormFilterInterface|bool
since |
4.0.0 |
---|
Arguments
- type
string
The rule type.- new
bool
Flag to toggle whether we should get a new instance of the object.
Response
FormFilterInterface|bool
FormRule object on success, false otherwise.
loadRuleClass
Attempt to import the FormRule class file if it isn't already imported.
loadRuleClass( type) : string|bool
You can use this method outside of Form for loading a rule for inheritance or composition.
since |
1.7.0 |
---|
Arguments
- type
string
Type of a rule whose class should be loaded.
Response
string|bool
Class name on success or false otherwise.
loadRuleType
Method to load a form rule object given a type.
loadRuleType( type, new = true) : \Joomla\CMS\Form\FormRule|bool
since |
1.7.0 |
---|
Arguments
- type
string
The rule type.- new
bool
Flag to toggle whether we should get a new instance of the object.
Response
FormRule|bool
FormRule object on success, false otherwise.
loadType
Method to load a form entity object given a type.
loadType( entity, type, new = true) :
Each type is loaded only once and then used as a prototype for other objects of same type. Please, use this method only with those entities which support types (forms don't support them).
since |
1.7.0 |
---|
Arguments
- entity
string
The entity.- type
string
The entity type.- new
bool
Flag to toggle whether we should get a new instance of the object.
Response
mixed
Entity object on success, false otherwise.
parseShowOnConditions
Parse the show on conditions
parseShowOnConditions( showOn, formControl = null, group = null) : array||string|int
since |
3.7.0 |
---|
Arguments
- showOn
string
Show on conditions.- formControl
string
Form name.- group
string
The dot-separated form group path.
Response
array<string|int, array<string|int, mixed>>
Array with show on conditions.
Properties
paths
Array with paths where entities(field, rule, form) can be found.
Array's structure:
paths: {ENTITY_NAME}:
- /path/1
- /path/2
since |
1.7.0 |
---|
Type(s)
array<string|int, array<string|int, mixed>>
prefixes
The class namespaces.
since |
3.8.0 |
---|
Type(s)
array<string|int, array<string|int, mixed>>
entities
Static array of Form's entity objects for re-use.
Prototypes for all fields and rules are here.
Array's structure: entities: {ENTITY_NAME}: {KEY}: {OBJECT}
since |
1.7.0 |
---|
Type(s)
array<string|int, array<string|int, mixed>>