2 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_Controller_Action_Helper_SyjPostData extends Zend_Controller_Action_Helper_Abstract
8 public function getPostData($form) {
9 if (is_string($form) and class_exists($form)) {
12 if (!$form instanceof Zend_Form) {
13 throw new Zend_Exception();
16 if (!$this->getRequest()->isPost()) {
17 throw new Syj_Exception_Request();
19 $data = $this->getRequest()->getPost();
21 if ($form instanceof Syj_Processor_Interface) {
22 $form->process($data);
25 if (!$form->isValid($data)) {
26 throw new Syj_Exception_Request();