relation in between controller and view
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6111061/render-the-values-of-controllers-to-view">render the values of controllers to view</a>  </p>
</blockquote>



<p>I am newbie to php and I am doing a project in php object and class.Here I am fetching all the data in controller in array format.now my problem is how to display all the result in view file.What will be the relation in between them.I am not using anyframework.in my controller I have made query like this</p>

<pre><code>&lt;?php
class UserController {
  public $db;
  public function __construct($db) {
    $this-&gt;db = $db;
  }
  public function index() {
    $this-&gt;view-&gt;data = $this-&gt;db-&gt;query("SELECT * FROM users"));
  }
 }
?&gt;
</code></pre>

<p>so how to do that?</p>
