compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (26)

View Page History
{code}
class MyformController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->multiPageForm->setForm(new MyForm());
$this->_helper->multiPageForm->setActions(array('order', 'user', 'survey'));
}

public function indexAction()
{
$this->_helper->multiPageForm->clear();
$this->getHelper('Redirector')->gotoAndExit('order');
}

public function orderAction()
{
// custom logic for order action
}

public function userAction()
{
// custom logic for user action
}

public function surveyAction()
{
// custom logic for survey action
}

public function processAction()
{
$data = $this->_helper->multiForm->getAllSubformData(); $this->_helper->multiPageForm->getFormData();

/**
* After fetching the data you'd probably want to clear the form
* so it can go for another round.
*/
$this->_helper->multiPageForm->clear();

/**
* Display a success screen for this demo.
* Note that all data in the $data array is filtered and validated,
* so you don't have to do that here anymore.
*/
$this->view->formData = $data;
}
{zone-data:skeletons}
{code}
class Zym_Controller_Action_Helper_MultiPageForm Zend_Controller_Action_Helper_MultiPageForm extends Zend_Controller_Action_Helper_Abstract
{
/**
* Default keys for controlling the multiform
*
*/
const ACTION_PREFIX = '_';
const ACTION_KEY_NEXT = '_next';
const ACTION_KEY_BACK = '_back';
const ACTION_KEY_SUBMIT = '_submit';
const ACTION_KEY_CANCEL = '_cancel';

/**
* Zend_Session storage object
*
* @var Zend_Session
*/
protected $_session = null;

/**
* The complete Zend_Form instance
*
* @var Zend_Form
*/
protected $_form = null;

/**
* The current subform instance
*
* @var Zend_Form
*/
protected $_currentSubForm = null;

/**
* The form data
*
* @var array
*/
protected $_tempFormData = array();

/**
* The form action in order of apearance
*
* @var array
*/
protected $_subFormActions = array();

/**
* The action that will be used for processing the form
*
* @var string
*/
protected $_processAction = 'process';

/**
* The action for canceling the form
*
* @var string
*/
protected $_cancelAction = null;

/**
* The last valid action
*
* @var string
*/
protected $_lastValidAction = null;

/**
* Construct and set default session object
*/
*
* @param string $action
* @return Zym_Controller_Action_Helper_MultiForm Zend_Controller_Action_Helper_MultiForm
*/
public function setProcessAction($action)
*
* @param string $action
* @return Zym_Controller_Action_Helper_MultiForm Zend_Controller_Action_Helper_MultiForm
*/
public function setCancelAction($action)
*
* @param array $actions
* @return Zym_Controller_Action_Helper_MultiForm Zend_Controller_Action_Helper_MultiForm
*/
public function setActions(array $actions)
* @param Zend_Form $values
* @param boolean $valid
* @return Zym_Controller_Action_Helper_MultiForm Zend_Controller_Action_Helper_MultiForm
*/
public function setValues(Zend_Form $form, $valid = false)

/**
* Retrieve current lsat valid action
*
* @return string
*/
public function getCurrentValidAction() getLastValidAction()
{
}
*
* @param Zend_Form $form
* @return Zym_Controller_Action_Helper_MultiForm Zend_Controller_Action_Helper_MultiForm
*/
public function setForm(Zend_Form $form)
* @return array
*/
public function getAllSubformData($flatten getFormData($flatten = false)
{
}
* @return array
*/
public function getFormData() getPostData()
{
}
*
* @param string $message
* @throws Zym_Controller_Exception Zend_Controller_Exception
*/
protected function _throwException($message)