Yes, surely it will give the output I wanted. Thank you for your work,
but what if I have to call myfunction one thousand times?
$this->set('fruits', $this->Test->myfunction(1));
$this->set('animals', $this->Test->myfunction(2));
.....
$this->set('colors', $this->Test->myfunction(1000));
I have no choice but to call $this->set() one thousand times in
Controller, and write foreach statement one thousand times in View.
On 1 4 , 2 49 , "TJSingleton" <[EMAIL PROTECTED]>
wrote:
> In actual, we can't get the desired output since we can't do the
> sequential outputs, call pass().ok, so is this what you mean?
VIEW
Header 1: Fruits are here. <br />
<?php
foreach ($fruits as $fruit) {
echo "$fruit<br />";}?>
Header 2: Animals are here. <br />
<?php
foreach ($animals as $animal) {
echo "$animal<br />";}?>
Header 3: Colors are here. <br />
<?php
foreach ($colors as $color) {
echo "$color<br />";}?>
CONTROLLER:
<?php
class TestsController extends AppController {
var $name = 'Tests';
function pass() {
$this->set('fruits', $this->Test->myfunction(1));
$this->set('animals', $this->Test->myfunction(2));
$this->set('colors', $this->Test->myfunction(3));
}
}--
TJ Singleton
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---