Welcome Guest, Not a member yet? Register   Sign In
New old story: POST arrays and repopulation
#1

[eluser]smith[/eluser]
I've read this in change log for version 1.60:
<i>Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)</i>

But, there is no useful example in documentation. Since we are all having problems since long ago, regarding repopulating and validating arrays, where do we stand now? Do we have good, working solution or not?

Someone, in some other thread, already asked about this: http://codeigniter.com/wiki/Assosiative_..._via_POST/, but there is no answear. So, i will ask again: doesn anyone know if we can use native CI functions to validate/repopulate _POST arrays or we should use some old rewritings and have hard time updating our applications. I am not sure why everything else is updated before POST arrays. I am sure that we all use arrays in our projects more than some other functions that were updated. And yet, we still don't know where to go with associative arrays. We have more than one solution for this, but i am sure that everyone would love to see problem solved in native CI. As i am writing this i am still having problems with those same POST arrays, waiting to see if native CI will be upgraded.

Thank you...
#2

[eluser]xwero[/eluser]
i'm working on a replacement library called Validate where it's possible to validate arrays. It's still in alpha so i would be glad if you could test the array input. Between adding features, writing documentation and having a private life i don't find the time to do much testing.

At the moment i'm adding a option to the rules which makes it possible to pinpoint when a field needs validation. In CI the only option you have is to add required to the rules or not.

For the repopulation i'm also writing a few extended input library methods because i think repopulation isn't a job for the validation library but for the input library. Another thing that doesn't belong to the validation library is the altering of the input value. This also belongs to the input library.

I know you want a CI solution and Derek Allard mentioned on his blog they are considering changes of the validation class but i think they are pretty tied up with moving EE to CI.
#3

[eluser]smith[/eluser]
Yes, i can do some testing, since my current project is on a crossroad because of lot of forms, and few include POST arrays Sad
#4

[eluser]xwero[/eluser]
I don't know if the library is what you want but it's based on all things i saw on the forum and some of my own ideas.

The features come down to
- rules as helper functions to use independent from the validation library
- validation for input from all globals (GET, POST, FILES, COOKIE) and from variables
- for loaded methods you don't need a callback but you can use the method rule




Theme © iAndrew 2016 - Forum software by © MyBB