title: Magento: Accessing models/blocks from a phtml
body: <p>Hi I have a situation where I need to look up the number of recently viewed products on catalog/product/view.phtml. In the recently viewed 'product_viewed.phtml' file it calls </p>
  
  <pre><code>$_products = $this-&gt;getRecentlyViewedProducts()
  </code></pre>
  
  <p>to get the recently viewed. How would I access this method from within the catalog/product/view.phtml file? </p>
  
  <p>I don't know where this method is. I've tried searching for it but it doesn't seem to exist. When I write click it in Netbeans and click go to declaration it takes me to </p>
  
  <pre><code>class Mage_Reports_Block_Product_Viewed extends Mage_Reports_Block_Product_Abstract
  </code></pre>
  
  <p>Actually on the class itself. This class only has _toHtml(), getCount(), and getPageSize() methods. </p>
  
  <p>I just need to know whether there are any recently viewed products. </p>
  
  <p>Any help most appreciated!</p>
  
  <p>Billy</p>