sosh wrote: > > Just a small question regarding how zend_form works... > > I understand that to validate submitted data against a form we use > something like: > $form->isValid($_POST) > > However, then to work with the acual data we use: > $form->getValues(); > > I don't really understand why in the first instance we are passing the > posted data to the form object, while in the second it seems that the data > exists already in the form object, as that is where we are getting it > from. Make sense? Any clarification would be appreciated. > > Thanks, > > S >
I think that isValid does more than just validate the data. It takes the raw $_POST data, applies any filters you specified, and then stores the filtered values. So when you call getValues(), the form returns the filtered values, rather than the raw ones. This would also explain why, after submitting a form, it will display the posted data without the need to call populate(). Pete Disclaimer: I'm new to this myself, so don't take my word as gospel. Hopefully someone more experienced will be able to confirm/deny what I've just said! -- View this message in context: http://www.nabble.com/Zend_Form-question-tp21145022p21145371.html Sent from the Zend Framework mailing list archive at Nabble.com.
