Class JFormHelper

Description

JForm's helper class.

Provides a storage for filesystem's paths where JForm's entities reside and methods for creating those entities. Also stores objects with entities' prototypes for further reusing.

  • since: 11.1

Located in /libraries/joomla/form/helper.php (line 23)


	
			
Direct descendents
Class Description
 class FOFFormHelper FOFForm's helper class.
Variable Summary
 static array $entities
 static array $paths
Method Summary
 static array addFieldPath ([mixed $new = null])
 static array addFormPath ([mixed $new = null])
 static array addPath (string $entity, [mixed $new = null])
 static array addRulePath ([mixed $new = null])
 static mixed loadClass (string $entity, string $type)
 static mixed loadFieldClass (string $type)
 static mixed loadFieldType (string $type, [boolean $new = true])
 static mixed loadRuleClass (string $type)
 static mixed loadRuleType (string $type, [boolean $new = true])
 static mixed loadType (string $entity, string $type, [boolean $new = true])
Variables
static array $entities = array() (line 56)

Static array of JForm's entity objects for re-use.

Prototypes for all fields and rules are here.

Array's structure:

  1.  {ENTITY_NAME}:
  2.  {KEY}{OBJECT}

  • since: 11.1
  • access: protected
static array $paths (line 40)

Array with paths where entities(field, rule, form) can be found.

Array's structure:

  1.  {ENTITY_NAME}:
  2.  - /path/1
  3.  - /path/2

  • since: 11.1
  • access: protected
Methods
static addFieldPath (line 237)

Method to add a path to the list of field include paths.

  • return: The list of paths that have been added.
  • since: 11.1
  • access: public
static array addFieldPath ([mixed $new = null])
  • mixed $new: A path or array of paths to add.
static addFormPath (line 251)

Method to add a path to the list of form include paths.

  • return: The list of paths that have been added.
  • since: 11.1
  • access: public
static array addFormPath ([mixed $new = null])
  • mixed $new: A path or array of paths to add.
static addPath (line 281)

Method to add a path to the list of include paths for one of the form's entities.

Currently supported entities: field, rule and form. You are free to support your own in a subclass.

  • return: The list of paths that have been added.
  • since: 11.1
  • access: protected
static array addPath (string $entity, [mixed $new = null])
  • string $entity: Form's entity name for which paths will be added.
  • mixed $new: A path or array of paths to add.
static addRulePath (line 265)

Method to add a path to the list of rule include paths.

  • return: The list of paths that have been added.
  • since: 11.1
  • access: public
static array addRulePath ([mixed $new = null])
  • mixed $new: A path or array of paths to add.
static loadClass (line 169)

Load a class for one of the form's entities of a particular type.

Currently, it makes sense to use this method for the "field" and "rule" entities (but you can support more entities in your subclass).

  • return: Class name on success or false otherwise.
  • since: 11.1
  • access: protected
static mixed loadClass (string $entity, string $type)
  • string $entity: One of the form entities (field or rule).
  • string $type: Type of an entity.

Redefined in descendants as:
static loadFieldClass (line 137)

Attempt to import the JFormField class file if it isn't already imported.

You can use this method outside of JForm for loading a field for inheritance or composition.

  • return: Class name on success or false otherwise.
  • since: 11.1
  • access: public
static mixed loadFieldClass (string $type)
  • string $type: Type of a field whose class should be loaded.

Redefined in descendants as:
static loadFieldType (line 68)

Method to load a form field object given a type.

  • return: JFormField object on success, false otherwise.
  • since: 11.1
  • access: public
static mixed loadFieldType (string $type, [boolean $new = true])
  • string $type: The field type.
  • boolean $new: Flag to toggle whether we should get a new instance of the object.

Redefined in descendants as:
static loadRuleClass (line 152)

Attempt to import the JFormRule class file if it isn't already imported.

You can use this method outside of JForm for loading a rule for inheritance or composition.

  • return: Class name on success or false otherwise.
  • since: 11.1
  • access: public
static mixed loadRuleClass (string $type)
  • string $type: Type of a rule whose class should be loaded.
static loadRuleType (line 83)

Method to load a form rule object given a type.

  • return: JFormRule object on success, false otherwise.
  • since: 11.1
  • access: public
static mixed loadRuleType (string $type, [boolean $new = true])
  • string $type: The rule type.
  • boolean $new: Flag to toggle whether we should get a new instance of the object.
static loadType (line 101)

Method to load a form entity object given a type.

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).

  • return: Entity object on success, false otherwise.
  • since: 11.1
  • access: protected
static mixed loadType (string $entity, string $type, [boolean $new = true])
  • string $entity: The entity.
  • string $type: The entity type.
  • boolean $new: Flag to toggle whether we should get a new instance of the object.

Redefined in descendants as:

Documentation generated on Tue, 19 Nov 2013 15:04:29 +0100 by phpDocumentor 1.4.3