PHP Classes

Update requests

Recommend this page to a friend!

      Nibble forms  >  All threads  >  Update requests  >  (Un) Subscribe thread alerts  
Subject:Update requests
Summary:Please post any updates/bugs requests/fixes
Messages:3
Author:Luke Rotherfield
Date:2011-01-06 00:01:14
Update:2011-03-02 00:04:43
 

  1. Update requests   Reply   Report abuse  
Picture of Luke Rotherfield Luke Rotherfield - 2011-01-06 00:01:15
Hi all

Thanks for taking the time to read this, please add any update requests or bug fixes here and I will try and get around to the asap.

Cheers
Luke

  2. Re: Update requests   Reply   Report abuse  
Picture of rudie dirkx rudie dirkx - 2011-01-16 19:44:51 - In reply to message 1 from Luke Rotherfield
* It'd be nice if the classes were separated (1 class per file) and namespaced (commented for our PHP < 5.3 friends).

* If I use the example on your docs website (username, checkbox, password + confirmation) and I validate the form when nothing was posted, I get a "Notice: Undefined index: confirm_password on line 328"
All fields are NOT posted, yet only 1 makes a Notice...

  3. Re: Update requests   Reply   Report abuse  
Picture of Luke Rotherfield Luke Rotherfield - 2011-03-02 00:04:43 - In reply to message 2 from rudie dirkx
Hi,
Sorry it took so long to respond, I only just became aware of your comment. As to the first point, I may one day split the file into separate classes, but at the moment it just seems like a pain to have to have so many files when most are only going to be a few lines long. What bonus would namespacing each file have over namespacing the current combined file?

Point two, this error is thrown up as the validate function in the Nibbleform class only validates against the POST value if it exists, however the confirm classes validate if they have been called against the POST value, irregardless of whether or not the value exists, thus only the confirm fields will throw an error if you try and validate without submitting a form. However there is no reason I can see (please let me know if I am missing something and I will sort it) to validate a form that is not submitted. That is why in my example I call the validate function inside and if statement that tests for $_POST['submit']. http://nibble-development.com/nibble-forms#overview

Hope that helps, if not let me know

Luke