有没有人有这样的例子:Zend Framework Multi Page Form
但是对于Zend Framework 2使用Zend \ Session?
答案 0 :(得分:6)
不应该有这样一个例子,因为这只是基础知识在一起玩:
public function multiFormAction()
{
$session = $yourSessionContainer();
if (false === $session->hasStepOneBeenDone()) {
$form = new FormStepOne();
// Check for Post
// Validate Form
// Render Form on Error or Post
// If Valid, safe Form Data into Session
}
if (false === $session->hasStepTwoBeenDone()) {
$form = new FormStepTwo();
// Check for Post
// Validate Form
// Render Form on Error or Post
// If Valid, safe Form Data into Session
}
if (false === $session->hasStepNBeenDone()) {
$form = new FormStepTwo();
// Check for Post
// Validate Form
// Render Form on Error or Post
// If Valid, safe Form Data into Session
}
}
创造这一点所需要的只是两个主题的知识: