In that case, my solution won't help you very much. Output is only
sent to the browser after the view is generated. You may be able to
speed up that process, but it is still being sent to the browser
afterwards.
Perhaps you can use AJAX for partial rendering, or cache the results
(or a combinati
Thanks, Martin. I'll try your suggestion.
What I am trying to accomplish was posted here today.
http://groups-beta.google.com/group/cake-php/browse_thread/thread/8968aaa372cc1e67
Any comments will be much appreciated.
On 1 4 , 9 47 , "Martin Schapendonk"
<[EMAIL PROTECTED]> wrote:
2007/1/3,
2007/1/3, skyblueink <[EMAIL PROTECTED]>:
I have no choice but to call $this->set() one thousand times in
Controller, and write foreach statement one thousand times in View.
Maybe you could make myfunction() a little bit more intelligent?
function myfunction($i) {
switch($i)
{
case 1:
Thanks Chris, I'll answer you in other thread.
On 1 4 , 6 00 , "Chris Hartjes" <[EMAIL PROTECTED]>
wrote:
On 1/3/07, skyblueink <[EMAIL PROTECTED]> wrote:
> 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?
>
On 1/3/07, skyblueink <[EMAIL PROTECTED]> wrote:
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));
.
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))
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.
";
}
?>
Header 2: Animals are here.
";
}
?>
Header 3: Colors are here.
";
}
?>
CONTROLLER:
set('fruits', $this->Test->myfunctio
but I'm not sure how your doing your
sequential outputs, or how you are calling pass.
Yeah, that's the problem, and I think it maybe the limitation of
CakePHP or in general MVC frameworks.
In actual, we can't get the desired output since we can't do the
sequential outputs, call pass().
On 1
This gives the desired output, but I'm not sure how your doing your
sequential outputs, or how you are calling pass.
VIEW:
";
}
?>
CONTROLLER:
set('results', $this->Test->myfunction($i));
$i += -1;
switch($i)
{
case 0:
$heading = 'Header 1: Fruits are here. ';
Hi, Signleton!
OK, let's see the original Controller.
function pass() {
$result = array();
for ($i = 1; $i <= 3; $i++) {
$result = am($result, $this->Test->myfunction($i));
}
$this->set('result',$result);
}
(1) The above code will give an output:
lemon
banana
apple
lion
t
skyblueink wrote:
Without using CakePHP or any other MVC framework, I would have
codedlike the following:
Can you give me an example of the final output you'd like it to
achieve?
--
TJ Singleton
--~--~-~--~~~---~--~~
You received this message because you a
skyblueink wrote:
I want to show progress indicator to the user of my program for each
run of $i for loop of pass(). The pass() function could be modified
like the following(see below), but it does not give the expected
results since $message and $result are overwritten repeatedly. This
time I
Without using CakePHP or any other MVC framework, I would have
codedlike the following:
function pass() {
for ($i = 1; $i <= 3; $i++) {
if ($i == 1) echo "Now, fruits are being collected.";
if ($i == 2) echo "Now, animals are being collected.";
if ($i == 3) echo "Now, co
OK, thanks to the help of kind people here I've got a working simple
example program(see below).
=The Example Code=
-test.php includes next lines
Test->myfunction($i));
}
$this->set('result',$result);
}
}
?>
-And, pass.thtml includes next lines.
";
}
?>
Currently, he output is:
lemon
14 matches
Mail list logo