public function populate(array $data) : Form
    {
        $this->resetErrors();

        foreach ($this->components as $name => $component) {
            $value = isset($data[$name]) ? $data[$name] : null;
            $component->populate($value);
        }

        return $this;
    }
public function populate(array $data) : Form
    {
        $this->resetErrors();

        foreach ($this->components as $name => $component) {
            $value = isset($data[$name]) ? $data[$name] : null;
            $component->populate($value);
        }

        return $this;
    }
public function populate ( array $ data ) : Form { $ this -> resetErrors ( ) ; foreach ( $ this -> components as $ name => $ component ) { $ value = isset ( $ data [ $ name ] ) ? $ data [ $ name ] : null ; $ component -> populate ( $ value ) ; } return $ this ; }
Populates the form with an associative array of data.

@param array $data

@return Form
Populates the form with an associative array of data .