title: Magento - Passing data between a controller and a block
body: <p>Really quick and simple question but I can't find a decent answer to this - What is the best way to pass data from a controller to a block in Magento.</p>
  
  <p>Incase it makes a difference, I am loading the layout as follows:</p>
  
  <pre><code> $this-&gt;loadLayout(array('default', 'myModule_default'));
  
      $this-&gt;_initLayoutMessages('customer/session')
           -&gt;_initLayoutMessages('catalog/session')
           -&gt;renderLayout();
  </code></pre>
  
  <p>I should add, that I have been using the registry as follows:</p>
  
  <p>In the controller:</p>
  
  <pre><code>Mage::register('data', $data);
  </code></pre>
  
  <p>In the block:</p>
  
  <pre><code>$data = Mage::registry('data');
  </code></pre>
  
  <p>Not sure if this is the best way to do it though.</p>