On 1/3/07, skyblueink <[EMAIL PROTECTED]> wrote:

I have a very simple program.

Here is the controller.
<?php
class TestsController extends AppController {
  var $name = 'Tests';

  function pass() {
     for ($i = 1; $i <= 3; $i++) {
       $this->set('message',"i is " . $i . "<br>");
     }
  }
}
?>

And here is the view.



$this->set doesn't automatically append values.  So, your loop should
be like this:

function pass() {
   for ($i = 1; $i <= 3; $i++) {
       $message .= "i is ". $i . "<br>";
   }

   $this->set('message', $message);
}

Hope that helps.


--
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to