title: Print variable from action zend2 framework
body: <p>I am trying to print a variable fromm saveAction so i can see what is the value of that variable. I am learning Zend2 and i have continued where other developer stoped so i am trying to understand it better...This application is also using Doctrin.</p>
  
  <p>I have this action which will save some data to database.</p>
  
  <pre><code>public function saveAction() {
      $view = new ViewModel();
      $logedUser = $this-&gt;getLogedUser();
  
      print_r($_POST);
  
      $shopId = (int) $this-&gt;params()-&gt;fromPost('shop_id', null);
  
      print_r($shopId);
  
      $shop = $this-&gt;getServiceLocator()
                      -&gt;get('Catalog\Model\Shop')
                      -&gt;getRepository()
                      -&gt;findOneBy(array('id' =&gt; $shopId, 'user' =&gt; $logedUser-&gt;getId()));
      print_r($shop);
  
      return $logedUser;
      return $shop;
      return $view;
  } 
  </code></pre>
  
  <p>I can print values from post, and variable shopId, but <code>print_r($shop);</code> doesn't show anything. How can i see the value of shop variable?</p>