CustomFields/CustomFieldText.php
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
    {
        $options =  $customField->getOptions();

        $type = ($options[self::MAX_LENGTH] < 256) ? 'text' 
              : 'textarea';

        $attrArray = array();

        if(array_key_exists(self::MULTIPLE_CF_INLINE, $options) and
            $options[self::MULTIPLE_CF_INLINE]) {
            $attrArray['class'] = 'multiple-cf-inline';   
        }
         
        $builder->add($customField->getSlug(), $type, array(
            'label' => $this->translatableStringHelper->localize($customField->getName()),
            'required' => false,
            'attr' => $attrArray
        ));
    }
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
    {
        $options =  $customField->getOptions();

        $type = ($options[self::MAX_LENGTH] < 256) ? 'text' 
              : 'textarea';

        $attrArray = array();

        if(array_key_exists(self::MULTIPLE_CF_INLINE, $options) and
            $options[self::MULTIPLE_CF_INLINE]) {
            $attrArray['class'] = 'multiple-cf-inline';   
        }
         
        $builder->add($customField->getSlug(), $type, array(
            'label' => $this->translatableStringHelper->localize($customField->getName()),
            'required' => false,
            'attr' => $attrArray
        ));
    }
Create a form according to the maxLength option

if maxLength < 256 THEN the form type is 'text'
if not, THEN the form type is textarea

@param FormBuilderInterface $builder
@param CustomField $customField