This gives the desired output, but I'm not sure how your doing your
sequential outputs, or how you are calling pass.

VIEW:
<?php
echo $heading;
$count = count($results);
foreach ($results as $result) {
    echo "$result<br />";
}
?>

CONTROLLER:
<?php
class TestsController extends AppController {
 var $name = 'Tests';

 function pass($i) {
   $this->set('results', $this->Test->myfunction($i));

     $i += -1;
     switch($i)
    {
       case 0:
           $heading = 'Header 1: Fruits are here. <br />';
           break;
       case 1:
           $heading = 'Header 2: Animals are here. <br />';
           break;
       case 2:
           $heading = 'Header 3: Colors are here. <br />';
           break;
    }
   $this->set('heading', $heading);
 }
}
?>


--~--~---------~--~----~------------~-------~--~----~
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