public static function create($type, $name, $value = null, array $attributes = [], array $options = [], $required = false, array $modifiers = [], array $validators = [], $validationErrorMessage = null) {

		$type = strtolower($type);

		if(is_array($value) && $type !== 'multipleselect') {
			$elem = self::createSingleElement($type, $name, null, $attributes, $options, $required, $modifiers, $validators, $validationErrorMessage);

			$elements = [];

			foreach($value as $k => $v) {
				$e = clone $elem;
				$e
					->setName(sprintf('%s[%s]', $name, $k))
					->setValue($v)
                ;
				$elements[$k] = $e;
			}

			unset($elem);
			return $elements;
		}

		else {
			return self::createSingleElement($type, $name, $value, $attributes, $options, $required, $modifiers, $validators, $validationErrorMessage);
		}
	}
public static function create($type, $name, $value = null, array $attributes = [], array $options = [], $required = false, array $modifiers = [], array $validators = [], $validationErrorMessage = null) {

		$type = strtolower($type);

		if(is_array($value) && $type !== 'multipleselect') {
			$elem = self::createSingleElement($type, $name, null, $attributes, $options, $required, $modifiers, $validators, $validationErrorMessage);

			$elements = [];

			foreach($value as $k => $v) {
				$e = clone $elem;
				$e
					->setName(sprintf('%s[%s]', $name, $k))
					->setValue($v)
                ;
				$elements[$k] = $e;
			}

			unset($elem);
			return $elements;
		}

		else {
			return self::createSingleElement($type, $name, $value, $attributes, $options, $required, $modifiers, $validators, $validationErrorMessage);
		}
	}
public static function create ( $ type , $ name , $ value = null , array $ attributes = [ ] , array $ options = [ ] , $ required = false , array $ modifiers = [ ] , array $ validators = [ ] , $ validationErrorMessage = null ) { $ type = strtolower ( $ type ) ; if ( is_array ( $ value ) && $ type !== 'multipleselect' ) { $ elem = self :: createSingleElement ( $ type , $ name , null , $ attributes , $ options , $ required , $ modifiers , $ validators , $ validationErrorMessage ) ; $ elements = [ ] ; foreach ( $ value as $ k => $ v ) { $ e = clone $ elem ; $ e -> setName ( sprintf ( '%s[%s]' , $ name , $ k ) ) -> setValue ( $ v ) ; $ elements [ $ k ] = $ e ; } unset ( $ elem ) ; return $ elements ; } else { return self :: createSingleElement ( $ type , $ name , $ value , $ attributes , $ options , $ required , $ modifiers , $ validators , $ validationErrorMessage ) ; } }
create either single FormElement or array of FormElements

@param string $type , type of element
@param string $name , name of element
@param mixed $value
@param array $attributes
@param array $options , array for initializing SelectOptionElements or RadioOptionElements
@param boolean $required
@param array $modifiers
@param array $validators
@param string $validationErrorMessage

@return FormElement | FormElement[]
@throws FormElementFactoryException
create either single FormElement or array of FormElements