Ive got some kind of a problem here. When I try this function, it return this error:
Catchable fatal error: Argument 1 passed to Zend_Form::populate() must be an array, object given, called in [..]
When I used print_r() to find the values of the 1st argument, the output was this:
Zend_Db_Table_Row Object ( [_data:protected] => Array ( [id] => 4 [title] => sd [name] => KG [picture] => http://xx/images/mny4r64mqb.png [show] => 1 [body] =>KB
) [..]
So I know, that the object I input is an array. What could be causing this problem? The model
public function getUser($id)
{
$id = (int)$id;
$row = $this->fetchRow('id = ' . $id);
$row->toArray();
if (!$row) {
throw new Exception("Could not find row $id");
}
return $row;
}
The controller:
$albums = new Admin_Model_Users ();
//print_r($albums->getUser($id));
$form->populate ( $albums->getUser ( $id ) );