Zend Framework 2 - 多页表单

时间:2013-08-28 17:53:12

标签: zend-framework2 zend-form2

有没有人有这样的例子:Zend Framework Multi Page Form
但是对于Zend Framework 2使用Zend \ Session?

1 个答案:

答案 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
    }
}

创造这一点所需要的只是两个主题的知识: