I'm trying to integrate my ZF app with Pommo (a great newsletters manager).
Pommo has its own registration page where users can subscribe, unsubscribe and update infos.
Looking at the code of the pommo registration page I got the url action of the form (/privatearea/pommo/user/process.php) as well as the form elements name (email and group).
I replicated the pommo registration form with zend form.
I'd like to make my form act this way during validation:
- if the form is NOT valid, return to form and show validation errors
- if the form is valid change the form action to /privatearea/pommo/user/process.php and send the request to that page
This is the code inside my controller to validate the form:
- Code: Select all
public function newsletterAction()
{
$newsletterForm = new Default_Model_NewsletterForm();
$this->view->newsletterForm = $newsletterForm;
if ($this->getRequest()->isPost())
{
$formData = $this->getRequest()->getPost();
if ($newsletterForm->isValid($formData))
{
//##### here goes the missing code... #####
$newsletterForm->setAction('/privatearea/pommo/user/process.php');
//##### ... or here #####
}
else
{
$newsletterForm->populate($formData);
}
}
}
If anyone has some idea, please let me know.
Thank you

