public static function getInstance(array $config = []) {
        // If element has no name
        if (!isset($config['name'])){
            throw new \Exception("You have to set the name of the field", 1);
        }
        if(!isset($config['class'])){
            $config['class'] = Text::className();
        }
        return parent::getInstance($config);
	}
public static function getInstance(array $config = []) {
        // If element has no name
        if (!isset($config['name'])){
            throw new \Exception("You have to set the name of the field", 1);
        }
        if(!isset($config['class'])){
            $config['class'] = Text::className();
        }
        return parent::getInstance($config);
	}
public static function getInstance ( array $ config = [ ] ) { // If element has no name
 if ( ! isset ( $ config [ 'name' ] ) ) { throw new \ Exception ( "You have to set the name of the field" , 1 ) ; } if ( ! isset ( $ config [ 'class' ] ) ) { $ config [ 'class' ] = Text :: className ( ) ; } return parent :: getInstance ( $ config ) ; }
Builds the field and returns it

@param array $name field config

@return Field instance

@throws Exception if the name of the field not found in config array
Builds the field and returns it