i am running a script in Zend Framework 2, the issue is how to stop the script from proceeding if certain conditions are not met
below is my function, you will note that i attempted to redirect the script if the condition of willMemberAcceptMessage() was not met
if(!$this->willMemberAcceptMessage())
{
$this->flashMessenger()->addMessage(static::ERROR_UNABLE_TO_PROCEED);
$this->redirect()->toUrl($url);
}
the problem is that the script does not redirect straight away, it still keeps running.
what should i do?