Populate form with array, how?


in my controller I have an array and I want pass this array to my form to populate it: `php $user = array( 'name' => 'John', 'phone' => '555', ); $userForm = new \Application\Forms\User($user); `

This gives back an error, even if I convert the $user to an object with (object).

How can I populate my form with the array?

Ok, my bad, it works if I convert it to object, there was a $this->setEntity() in the form which overwrote it.

$form->bind($_POST, null);