getTypes() public method

Returns the types used by this form.
public getTypes ( ) : array
return array An array of FormTypeInterface
Beispiel #1
0
 /**
  * guessFormFieldType
  * 
  * Guess Form Field Type
  * 
  * @param $field :  field to guess the type
  *
  * @return field Type (string,integer,datetime,...)
  */
 public function guessFormFieldType(\Symfony\Component\Form\Form $field)
 {
     $types = $field->getTypes();
     $len = count($types) - 1;
     $className = get_class($types[$len]);
     $name = substr($className, strrpos($className, '\\') + 1);
     $type = str_replace('Type', '', $name);
     return $type;
 }