W3cubDocs

/Symfony 2.7

Symfony\Component\Form\FormView

class FormView implements ArrayAccess, IteratorAggregate, Countable

Properties

array $vars The variables assigned to this view.
FormView $parent The parent view.
FormView[] $children The child views.

Methods

__construct(FormView $parent = null)
bool isRendered()

Returns whether the view was already rendered.

FormView setRendered()

Marks the view as rendered.

FormView offsetGet(string $name)

Returns a child by name (implements \ArrayAccess).

bool offsetExists(string $name)

Returns whether the given child exists (implements \ArrayAccess).

offsetSet($name, $value)

Implements \ArrayAccess.

offsetUnset(string $name)

Removes a child (implements \ArrayAccess).

ArrayIterator getIterator()

Returns an iterator to iterate over children (implements \IteratorAggregate)

int count()

Implements \Countable.

Details

public __construct(FormView $parent = null)

Parameters

FormView $parent

public bool isRendered()

Returns whether the view was already rendered.

Return Value

bool Whether this view's widget is rendered.

public FormView setRendered()

Marks the view as rendered.

Return Value

FormView The view object.

public FormView offsetGet(string $name)

Returns a child by name (implements \ArrayAccess).

Parameters

string $name The child name

Return Value

FormView The child view

public bool offsetExists(string $name)

Returns whether the given child exists (implements \ArrayAccess).

Parameters

string $name The child name

Return Value

bool Whether the child view exists

public offsetSet($name, $value)

Implements \ArrayAccess.

Parameters

$name
$value

Exceptions

BadMethodCallException always as setting a child by name is not allowed

public offsetUnset(string $name)

Removes a child (implements \ArrayAccess).

Parameters

string $name The child name

public ArrayIterator getIterator()

Returns an iterator to iterate over children (implements \IteratorAggregate)

Return Value

ArrayIterator The iterator

public int count()

Implements \Countable.

Return Value

int The number of children views

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Form/FormView.html