Andrew,
The ->forward() method throws an exception:
throw new sfActionStopException();
This exception stops the code to stop the execution of your action and
of the current filter chain. That's why you don't have to put a 'return'
statement before a ->forward() (or a ->redirect()).
But in your case, you catch the Exception, so, the action is not
stopped. Try to change your code with:
$this->forward($this->getModuleName(), 'getToIt');
return sfView::NONE;
to see if it solves your problem.
You can also trap the sfActionStopException in your code.
Fabien
Andrew Backer wrote:
I am having an issue that was discussed before, where two templates show
sometimes. I haven't done much investigation, but this is happening to
me when I have a $this->forward() inside of a try/catch block. The code
is something like this :
// page posted to from the getToIt action
try {
...
...
if ( $obj->status() == no_good) {
...
// this forward gets called, actually, and goes f
$this->forward($this->getModuleName(), 'getToIt');
}
} catch {
// if I put a echo "blah";die(); here it will show at bottom of page
$this->log->err(" it didn't work! fix your code, bad coder person");
}
I can stop it by actually putting a die() inside the catch. I have no
clue what is going on, but I assume it is something with the way php
works and the fact that isn't not quite 'real' in it's objects (like
letting functions be called statically when they aren't) that makes this
thing do two actions.
Anyone have any ideas? I am going to re-arrange the code so this
doesn't happen now, but it's still quite odd.
- Andrew
--
To unsubscribe, e-mail:
user-unsubscribe-eP6cZdsBvs6tlBvVaVFjCkEOCMrvLtNR@xxxxxxxxxxxxxxxx
For additional commands, e-mail:
user-help-eP6cZdsBvs6tlBvVaVFjCkEOCMrvLtNR@xxxxxxxxxxxxxxxx
|