Property | Type | Description | |
---|---|---|---|
$extraFields | array | Contains the names of bound values who don't belong to any fields | |
$fields | array | Contains all the fields of this group |
Method | Description | |
---|---|---|
__clone ( ) | Clones this group | |
add ( Symfony\Component\Form\FieldInterface $field ) | Adds a new field to this group. A field must have a unique name within the group. Otherwise the existing field is overwritten. | |
addError ( Symfony\Component\Form\FieldError $error, Symfony\Component\Form\PropertyPathIterator $pathIterator = null, $type = null ) | {@inheritDoc} | |
bind ( string | array $taintedData ) : boolean | Binds POST data to the field, transforms and validates it. | |
count ( ) : integer | Returns the number of form fields (implements the \Countable interface). | |
get ( string $key ) : Symfony\Component\Form\FieldInterface | Returns the field with the given key. | |
getAllHiddenFields ( ) : array | Returns an array of hidden fields from the current schema. | |
getAllVisibleFields ( ) : array | Returns an array of visible fields from the current schema. | |
getDisplayedData ( ) | Returns the data of the field as it is displayed to the user. | |
getFields ( ) : array | Returns all fields in this group | |
getHiddenFields ( ) : array | Returns an array of hidden fields from the current schema. | |
getIterator ( ) : ArrayIterator | Returns the iterator for this group. | |
getVisibleFields ( ) : array | Returns an array of visible fields from the current schema. | |
has ( string $key ) : boolean | Returns whether a field with the given key exists. | |
isBoundWithExtraFields ( ) : boolean | Returns whether this form was bound with extra fields | |
isMultipart ( ) : boolean | Returns whether the field requires a multipart form. | |
isValid ( ) : boolean | Returns whether the field is valid. | |
merge ( |
Merges a field group into this group. The group must have a unique name within the group. Otherwise the existing field is overwritten. | |
offsetExists ( string $key ) : boolean | Returns true if the bound field exists (implements the \ArrayAccess interface). | |
offsetGet ( string $key ) : |
Returns the form field associated with the name (implements the \ArrayAccess interface). | |
offsetSet ( $key, $field ) | Throws an exception saying that values cannot be set (implements the \ArrayAccess interface). | |
offsetUnset ( string $key ) | Throws an exception saying that values cannot be unset (implements the \ArrayAccess interface). | |
remove ( string $key ) | Removes the field with the given key. | |
setData ( $data ) | Initializes the field group with an object to operate on | |
setLocale ( $locale ) | Sets the locale of this field. |
Method | Description | |
---|---|---|
getFieldsByVisibility ( boolean $hidden, boolean $recursive ) : array | Returns a filtered array of fields from the current schema. | |
preprocessData ( array $data ) : array | Processes the bound data before it is passed to the individual fields |
class Entity
{
public $location;
}
class Location
{
public $longitude;
public $latitude;
}
$entity = new Entity();
$entity->location = new Location();
$form = new Form('entity', $entity, $validator);
$locationGroup = new FieldGroup('location');
$locationGroup->add(new TextField('longitude'));
$locationGroup->add(new TextField('latitude'));
$form->add($locationGroup);
public add ( Symfony\Component\Form\FieldInterface $field ) | ||
$field | Symfony\Component\Form\FieldInterface |
public addError ( Symfony\Component\Form\FieldError $error, Symfony\Component\Form\PropertyPathIterator $pathIterator = null, $type = null ) | ||
$error | Symfony\Component\Form\FieldError | |
$pathIterator | Symfony\Component\Form\PropertyPathIterator |
public getAllHiddenFields ( ) : array | ||
return | array |
public getAllVisibleFields ( ) : array | ||
return | array |
public getDisplayedData ( ) |
public getHiddenFields ( ) : array | ||
return | array |
public getIterator ( ) : ArrayIterator | ||
return | ArrayIterator |
public getVisibleFields ( ) : array | ||
return | array |
public isBoundWithExtraFields ( ) : boolean | ||
return | boolean |
public isMultipart ( ) : boolean | ||
return | boolean |
class Entity
{
public $longitude;
public $latitude;
}
$entity = new Entity();
$form = new Form('entity', $entity, $validator);
$locationGroup = new FieldGroup('location');
$locationGroup->add(new TextField('longitude'));
$locationGroup->add(new TextField('latitude'));
$form->merge($locationGroup);
public merge ( |
||
$group |
public offsetExists ( string $key ) : boolean | ||
$key | string | The key of the bound field |
return | boolean | true if the widget exists, false otherwise |
public offsetSet ( $key, $field ) |
public offsetUnset ( string $key ) | ||
$key | string |
protected preprocessData ( array $data ) : array | ||
$data | array | |
return | array |
public setData ( $data ) |
protected array $extraFields | ||
return | array |
protected array $fields | ||
return | array |