Back to FormHelper class

Method loadFieldType

public static \Joomla\CMS\Form\FormField|bool
loadFieldType
(mixed $type, mixed $new = true)
Method to load a form field object given a type.
Parameters
  • string $type The field type.
  • bool $new Flag to toggle whether we should get a new instance of the object.
Returns
  • \Joomla\CMS\Form\FormField|bool FormField object on success, false otherwise.
Since
  • 1.7.0
Class: FormHelper
Project: Joomla

Method loadFieldType - Source code

/**
 * Method to load a form field object given a type.
 *
 * @param   string   $type  The field type.
 * @param   boolean  $new   Flag to toggle whether we should get a new instance of the object.
 *
 * @return  FormField|boolean  FormField object on success, false otherwise.
 *
 * @since   1.7.0
 */
public static function loadFieldType($type, $new = true)
{
    return self::loadType('field', $type, $new);
}