title: Access views in Models/Controllers
body: <p><strong>I have a class MyData.php like this:</strong></p>
  
  <pre><code>class myData {
    function render() {
      $view = new Zend_View();
      $view-&gt;str = 'This is string.';
      echo $view-&gt;render('myview.phtml');
    }
  }
  </code></pre>
  
  <p><strong>and a myview.phtml file:</strong></p>
  
  <pre><code>&lt;div id='someid'&gt;&lt;?= $this-&gt;str ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In another view I am doing something like this:</p>
  
  <pre><code>&lt;?php
      $obj = new myData ();
      $obj-&gt;render(); // it should be &lt;div id='someid'&gt;This is string.&lt;/div&gt;
  ?&gt;
  </code></pre>
  
  <p>It is giving me following exception:</p>
  
  <pre><code>Message: no view script directory set; unable to determine location for view script
  </code></pre>
  
  <p><strong>MyData.php</strong> and <strong>myview.phtml</strong> are in same directory.</p>