title: How to pass 2 arrays as params from controller to view
body: <p>I am working with the zend framework and am trying to create an edit contacts page. When the page loads I want to display a form with the current stored values for those fields. </p>
  
  <p>I am trying to pass a form and the database values to my view so that I can pre-populate the form with the current values for those fields. I can pass the form or the array of contacts. But when I try to pass both one of the arrays will return null</p>
  
  <pre><code>public function editContactAction()
  {
      $form = new EditContact();
      $id = $this-&gt;params()-&gt;fromRoute('contactId');
  
      $variables = array();
      $contactService = $this-&gt;getServiceLocator()-&gt;get('User\Service\UserService');
  
      $variables['contacts'] = $contactService-&gt;editContact($id);
  
      return new ViewModel(array('form' =&gt; $form), $variables);
  }
  </code></pre>