english/libraries/joomla/form/helper.php
/**
	 * 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).
	 *
	 * @param   string  $entity  One of the form entities (field or rule).
	 * @param   string  $type    Type of an entity.
	 *
	 * @return  mixed  Class name on success or false otherwise.
	 *
	 * @since   11.1
	 */
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).

@param   string  $entity  One of the form entities (field or rule).
@param   string  $type    Type of an entity.

@return  mixed  Class name on success or false otherwise.


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 ) . @param string $entity One of the form entities ( field or rule ) . @param string $type Type of an entity . @return mixed Class name on success or false otherwise .
protected static function loadClass($entity, $type)
	{
		$class = 'JForm'.ucfirst($entity).ucfirst($type);
		if (class_exists($class)) return $class;
		$paths = JFormHelper::addPath($entity);
		if ($pos = strpos($type, '_')) {
			for ($i = 0, $n = count($paths); $i < $n; $i++) {
				$path = $paths[$i].'/'.strtolower(substr($type, 0, $pos));
				if (!in_array($path, $paths)) {
					array_unshift($paths, $path);
				}
			}
			$type = substr($type, $pos+1);
		}
		if ($file = JPath::find($paths, strtolower($type).'.php')) {
			require_once $file;
		}
		return class_exists($class) ? $class : false;
	}
protected static function loadClass ( $ entity , $ type ) { $ class = 'JForm' . ucfirst ( $ entity ) . ucfirst ( $ type ) ; if ( class_exists ( $ class ) ) return $ class ; $ paths = JFormHelper :: addPath ( $ entity ) ; if ( $ pos = strpos ( $ type , '_' ) ) { for ( $ i = 0 , $ n = count ( $ paths ) ; $ i < $ n ; $ i ++ ) { $ path = $ paths [ $ i ] . '/' . strtolower ( substr ( $ type , 0 , $ pos ) ) ; if ( ! in_array ( $ path , $ paths ) ) { array_unshift ( $ paths , $ path ) ; } } $ type = substr ( $ type , $ pos + 1 ) ; } if ( $ file = JPath :: find ( $ paths , strtolower ( $ type ) . '.php' ) ) { require_once $ file ; } return class_exists ( $ class ) ? $ class : false ; }
Load a class for one of the form's entities of a particular type.
Load a class for one of the form ' s entities of a particular type .
// Get the field search path array. // If the type is complex, add the base type to the paths. // Add the complex type prefix to the paths. // Derive the new path. // If the path does not exist, add it. // Break off the end of the complex type. // Try to find the class file. // Check for all if the class exists.