title: How to load a magento view (.phtml) file from a controller
body: <p>Im trying to load a rendered version of the cart sidebar, which i intend to load via ajax... I've been searching around alot and it seems like the best approach is to create a custom module which will handle all my ajax request. I have created a custom module and everything seems to be working however when I display the sidebar.phtml it is not rendered properly. It displays as if there is nothing in the cart. (im assuming its just trying to reading the file without using any session info). I've search a bunch but nothing seems relevant to what I'm trying to do. </p>
  
  <p>This is the code im using in my custom controller to load the phtml file which is essentially a copy and past of the checkout/cart/sidebar.phtml file. </p>
  
  <pre><code>$layout = $this-&gt;loadLayout();
  
  
  $block = $this-&gt;getLayout()-&gt;createBlock(
  'Mage_Core_Block_Template',
  'PPWD_Custom',
  array('template' =&gt; 'custom/custom.phtml')
  );
  echo $block-&gt;toHtml(); 
  </code></pre>
  
  <p>Thanks</p>