title: setting public class property in Yii framework
body: <p>In the controller (which is a class called MessageController), there is this code, which renders a "view" file named helloWorld and also sets an array where the variable $theTime is connected to the key 'time'. </p>
  
  <pre><code>$theTime = date("D M j G:i:s T Y"); 
  $this-&gt;render('helloWorld',array('time'=&gt;$theTime));
  </code></pre>
  
  <p>In the view helloWorld file, the key 'time' from the controller  is displayed here through the variable $time</p>
  
  <pre><code>&lt;h3&gt;&lt;?php echo $time; ?&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>this works perfectly. However, the book also suggests trying another way. It says</p>
  
  <blockquote>
    <p>Alter the previous example by defining
    a public class property on
    MessageController, rather than a
    locally scoped variable, whose value
    is the current date and time. Then
    display the time in the view file by
    accessing this class property through
    $this.</p>
  </blockquote>
  
  <p>I haven't been able to figure out how to do this. Anyone know how</p>