문제

Does anyone have an example like this: Zend Framework Multi Page Form
But for Zend Framework 2 using Zend\Session?

도움이 되었습니까?

해결책

There shouldn't be any need for such an example as this is nothing but Basics playing together:

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

All that's needed to create this is knowledge in two topics:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top