Hi there,
On 16 Jul 2009, at 08:31, nulele wrote:
Thank you for your attempt but unfortunately this method doesn't
work... if
the form is valid I simply see the form again...
Maybe I need something to capture the post request from the form and
send it
to the pommo's page... but how?
I know you don't want to totally rewrite the existing pommo code, but
is it possible to extract the functionality AFTER it collects its data
from $_POST?
The most straight-forward thing to do may be to wrap that bit of the
pommo code in a class method of your own (an Adapter) and then call it
from within your action controller.
(The/An alternative would seem to be to form a new HTTP request,
including POST data, and fire that off to the pommo URL.
Zend_Http_Client.)
HTH,
Regards,
Carlton
Eugene Morgan wrote:
If I understand correctly what you are trying to do, I think all you
need to do is immediately after you instantiate the $newsletterForm,
set its action to what you want (not after it's posted) ...
i.e.,
$newsletterForm = new Default_Model_NewsletterForm();
$newsletterForm->setAction('/areaprivata/pommo/user/process.php');
Does that help?
On Wed, Jul 15, 2009 at 5:08 AM, nulele<nul...@gmail.com> wrote:
hello nabble!!
I'm trying to integrate my zend application with pommo.
I don't want to replicate pommo's logic on new user subscription by
creating
zend_db objects for every pommo's table... I just want to:
1) create the subscription form with zend_form,
2) validate the form on zend side
3) submit the form to the pommo's page used to insert new user
I've already completed the first 2 steps... here's the code in my
controller
to validate the form:
public function newsletterAction()
{
$newsletterForm = new Default_Model_NewsletterForm();
$this->view->newsletterForm = $newsletterForm;
if ($this->getRequest()->isPost())
{
$formData = $this->getRequest()->getPost();
if ($newsletterForm->isValid($formData))
{
$newsletterForm->setAction('/areaprivata/pommo/user/process.php');
#### HERE GOES THE MISSING CODE #####
}
else
{
$newsletterForm->populate($formData);
}
}
}
If anyone has an idea, please let me know.
Many Thanks
--
View this message in context:
http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24495073.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
View this message in context:
http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24511659.html
Sent from the Zend Framework mailing list archive at Nabble.com.