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)


	
			
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 method addFieldPath (line 238)

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 method addFormPath (line 252)

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 method addPath (line 282)

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 method addRulePath (line 266)

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 method loadClass (line 170)

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.
static method loadFieldClass (line 138)

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.
static method 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.
static method loadRuleClass (line 153)

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

Documentation generated on Mon, 25 Jun 2012 13:55:24 -0500 by phpDocumentor 1.4.4