Zend Framework: formlar Zincirleme: nasıl I "unset $ this-> getRequest-> isPost ()"?

0 Cevap php

Bu oldukça basit bir şeydir ama Zend Framework ile bu "doğru" çözmek için nasıl anlamaya olamaz:

Senaryo:

  1. Page görüntüler, 1 oluşturacak
  2. Sayfa görüntüleme formu 2

Bu oldukça basit bir şeydir ama Zend Framework ile bu "doğru" çözmek için nasıl anlamaya olamaz:

Senaryo:

  1. Page görüntüler, 1 oluşturacak
  2. Page görüntüler 2 oluştururlar
class FooController extends Zend_Controller_Action {  
    ...  
    public function form1Action(){  
        if ($this->getRequest()->isPost()) {  
           // save data from form1 in database  
           $this->_forward('form2');  
        }  
        // display form1  
    }  
    public function form2Action(){  
        if ($this->getRequest()->isPost()) {  
           // save data from form2 in database  
           $this->_forward('somewherelese');  
        }  
        // display form2  
    }  
}  

Ne zaman kullanıcı mesaj form1, ilk eğer koşul form1Action (I istediğimiz şeydir) idam değil, aynı zamanda bir eğer-koşul form2Action içinde.

Ne ayak doğru yolu "-> isPost () unset $ this-> getRequest ()" olurdu?

Not: formlar "elle" inşa edilir (Zend Formu'nu kullanarak değil)

0 Cevap