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’.
$theTime = date("D M j G:i:s T Y");
In the view helloWorld file, the key ‘time’ from the controller is displayed here through the variable $time
<h3><?php echo $time; ?></h3>
this works perfectly. However, the book also suggests trying another way. It says
I haven’t been able to figure out how to do this. Anyone know how