php - Need Help with Zend Form -


I am currently making a Zend Form Status dropdown so that users can update their status.

All Status values ​​are coming from the database

I'm experiencing this problem when the form goes through the verification process, getProviderQuoteStatus ($ providerId, Using the $ quoteId, $ quoteStatusId method

I'm living in '1' did not get in the heap of grass (because the status value is in the controller population, not the form, hence the provider QuoteStatus form element Array is empty).

  getProviderQuoteStatusForm () {$ form = new Application_Form_ProviderQuoteStatus (array ('action' = & gt; '/ clue / update-provider-quote-status', 'method' = & gt; ;' Post ',)); $ Form return; } Private function getProviderQuoteStatus ($ providerId, $ quoteId, $ quoteStatusId) {$ form = $ this- & gt; GetProviderQuoteStatusForm (); $ ProviderQuoteStatus = New Application_Model_DbTable_ProviderQuoteStatus (); $ ProviderQuoteStatusValues ​​= $ providerQuoteStatus- & gt; GetProviderQuoteStatusUpdateValues ​​($ quoteStatusId); $ Form & gt; GetElement ('providerQuoteStatus') - & gt; AddMultiOptions ($ providerQuoteStatusValues); $ Form & gt; GetElement ('providerQuoteStatus') - & gt; SetValue ($ quoteStatusId); $ Form & gt; GetElement ('quoteId') - & gt; SetValue ($ quoteId); // return quotation id for the hidden field; $ form; } Public Function Update ProviderContestatus Action () {$ form = $ this- & gt; GetProviderQuoteStatusForm (); // Status Update dropdown box $ this- & gt; View- & gt; Form = $ form; If ($ the-> getRequest () -> isPost ()) {// is the post type request $ formData = $ this- & gt; GetRequest () - & gt; GetPost (); If ($ form-> is invalid ($ formData)) {// Form Elements $ quoteId = $ form- & gt; GetValue ('quoteId') has been validated; $ Provider QuoteStatus = $ form-> GetValue ('providerQuoteStatus'); $ This- & gt; _helper-> Redirector ('Leader'); // Back to // $ this-> _wardward ('clues'); } $ Form- & gt; Populate ($ formData); }}    

:

Default, this element registers an InArray validator that confirms the registered options against the array keys. You can disable either the calling setRegisterInArrayValidator (wrong) or by behavior, or you can pass a FALSE value for the register INArrayValidator configuration key.

Before I get this problem and the trick to deactivate this default validator

Comments