english/libraries/joomla/form/helper.php
/**
	 * 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.
	 *
	 * @param   string  $entity  Form's entity name for which paths will be added.
	 * @param   mixed   $new     A path or array of paths to add.
	 *
	 * @return  array  The list of paths that have been added.
	 * @since   11.1
	 */
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.

@param   string  $entity  Form's entity name for which paths will be added.
@param   mixed   $new     A path or array of paths to add.

@return  array  The list of paths that have been added.
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 . @param string $entity Form ' s entity name for which paths will be added . @param mixed $new A path or array of paths to add . @return array The list of paths that have been added .
protected static function addPath($entity, $new = null)
	{
		$paths = &self::$paths[$entity];
		if (empty($paths)) {
			$entity_plural = $entity . 's';
			$paths[] = dirname(__FILE__) . '/' . $entity_plural;
		}
		settype($new, 'array');
		foreach ($new as $path) {
			if (!in_array($path, $paths)) {
				array_unshift($paths, trim($path));
			}
		}
		return $paths;
	}
protected static function addPath ( $ entity , $ new = null ) { $ paths = & self :: $ paths [ $ entity ] ; if ( empty ( $ paths ) ) { $ entity_plural = $ entity . 's' ; $ paths [ ] = dirname ( __FILE__ ) . '/' . $ entity_plural ; } settype ( $ new , 'array' ) ; foreach ( $ new as $ path ) { if ( ! in_array ( $ path , $ paths ) ) { array_unshift ( $ paths , trim ( $ path ) ) ; } } return $ paths ; }
Method to add a path to the list of include paths for one of the form's entities.
Method to add a path to the list of include paths for one of the form ' s entities .
// Reference to an array with paths for current entity // Add the default entity's search path if not set. // While we support limited number of entities (form, field and rule) // we can do this simple pluralisation: // But when someday we would want to support more entities, then we should consider adding // an inflector class to "libraries/joomla/utilities" and use it here (or somebody can use a real inflector in his subclass). // see also: pluralization snippet by Paul Osman in JControllerForm's constructor. // Force the new path(s) to an array. // Add the new paths to the stack if not already there.