title: Magento How to pass data from a controller to a template?
body: <p>I have a controller action that connects to a XML feed and bring some data from a third party application. 
  Now I want this data to be presented in my Magento product page. Controller action get called as an ajax call by a parent template file and data has to be rendered in to one of the child templates.</p>
  
  <p>I know if I had a Model then that can talk to a Block and then the data can be available at template level. But not sure how this can be done through a controller action. So far I managed to dump the data to the child template but not the fully rendered HTML. (I dont want to build the HTML in the controller and dump it to the template as it is bad practice I reckon)</p>
  
  <p>Following is my controller action and getProduct </p>
  
  <pre><code>public function getFeedbackAction()
  {
  
      $url = 'http://3rd-party-domain/some-module/xmlfeed.php';
  
      $xml_feed = simplexml_load_file($url);
  
      foreach ($xml_feed as $key=&gt;$feedback){
          if ($key == "PRODUCT") {
              $this-&gt;feedbacks[] = $feedback;
          }
      }
  
      if ($this-&gt;getRequest()-&gt;getParam('type') == 'product'){
          $sku = $this-&gt;getRequest()-&gt;getParam('sku');
          if ( $sku != ""){
              $this-&gt;getProductReviews($sku); 
          }
      } 
  }
  
  private function getProductReviews($sku){
  
      foreach ($this-&gt;feedbacks as $feedback){
          if ($feedback-&gt;PRODUCTCODE == $sku){
              $productreviews[] = $feedback;
          }
      }
  
      Zend_Debug::dump($productreviews);
  
      //echo $this-&gt;getLayout()-&gt;createBlock('mymodule/reviews')-&gt;setTemplate('mymodule/reviews.phtml')-&gt;toHtml();
  
  }
  </code></pre>