Class method chaining
<p>I have the following code but it does not seem to want to work chained.</p>

<pre><code> $this-&gt;view-&gt;setData($class_vars);
 $this-&gt;view-&gt;render('addview'); 
</code></pre>

<p>The above works and runs fine but when i try to do the following:</p>

<pre><code> $this-&gt;view-&gt;setData($class_vars)-&gt;render('addview');
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>Fatal error: Call to a member function render() on a non-object in....</p>
</blockquote>

<p>But the strange thing is when i call it the other way:</p>

<pre><code> $this-&gt;view-&gt;render('addview')-&gt;setData($class_vars);
</code></pre>

<p>It runs, but I need the setData to run first as this sets up the var for the actual view, so even though i get the view its got errors where the vars should be? Both methods are public?</p>

<p>Thanks You</p>
