• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FYI - Validation takes forever

Big Grin 
I don't really seem to have anyplace else to talk about this at the moment and just needed to share, so forgive me. But - man! - writing the Validation library seems to be taking forever. I'm getting close, I really am, but seems there's always more when I turn around. Smile

Since I'm here, though, here's a brief overview of the goodies the new Validation library setup is giving you:

  1. Validation isn't tied for $_POST, but easily used with any set of data now. Though it's simple to use with your normal $_POST data also.
  2. Easier than ever to write custom rules. They're now classes that can live anywhere, and you just need to set the class' location in the config file. This also makes it simple to organize different types of rules so they can be re-used from project to project, and only load the ones you need.
  3. The Controller provides a convenience method for working with $_POST data that has been submitted.
  4. Validation is also built into the Model if you want to use it there, either alone or in combination with the Controller validation. There are times when one makes more sense than the other.
  5. The display of errors now uses view files so you can easily customize the output, and even provide several options if you need the HTML to be different in different locations.
  6. Files are now treated as any other form input, as far as validation goes, and new validation rules exist for validating file mime types, extensions, size on disk, ensure it's an image, and even ensure the dimensions of the image are within your requirements.
  7. For those doing ecommerce work, we also now have credit card numbering verification for 20 different card types, including 6 in Canada, a Chinese card, and at least one Russian card. This doesn't validate the card number only ensures it matches the requirements for that card type to be a possible real card.
  8. OH! One of the things that started me down this path in the first place - new required_with, required_without, and enhanced is_unique methods should now make it possible to use the same rules for both creating and updating records.

Whew! There's probably more, but that's the big stuff that comes to mind right now. You guys asked for something slightly more flexible and powerful, and I think this delivers. Hope to have this integrated into the main CI4 repo within the next week or so.

Messages In This Thread
FYI - Validation takes forever - by kilishan - 09-19-2016, 10:05 PM
RE: FYI - Validation takes forever - by InsiteFX - 09-20-2016, 02:33 AM
RE: FYI - Validation takes forever - by cartalot - 09-20-2016, 01:14 PM
RE: FYI - Validation takes forever - by kilishan - 09-21-2016, 09:51 PM
RE: FYI - Validation takes forever - by zurtri - 09-22-2016, 03:58 PM
RE: FYI - Validation takes forever - by cartalot - 09-22-2016, 05:18 PM
RE: FYI - Validation takes forever - by kilishan - 09-22-2016, 09:03 PM
RE: FYI - Validation takes forever - by jlp - 09-22-2016, 08:48 PM
RE: FYI - Validation takes forever - by Muzikant - 09-24-2016, 11:54 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.