Poll: Do we need new solution for Form filtering and validation?
You do not have permission to vote in this poll.
Yes
53.33%
16 53.33%
No
36.67%
11 36.67%
maybe
10.00%
3 10.00%
Total 30 vote(s) 100%
* You voted for this item. [Show Results]

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input filtering and Form validation

#1
I think that we have to create, new solution for Form validation and filtering.
At the moment Controllers take a huge amount of code only for validating forms which is not very right. 

Currently at other frameworks there are solutions as FormTypes/FormRequests/.. class's which are extended for each form there is and they are configurable. Setting validation rules and filtering and other related things as error messages. The combination of filtering + validation will remove the need of devs to validate anything inside the controllers.  
Once defined such class can be auto validated with our build in Validation library as it is now, and inside Controllers there will be just 1 initialization of this form validation.
Best VPS Hosting : Digital Ocean
Reply

#2
This is very easily done by creating your own library
Reply

#3
(04-06-2015, 10:53 PM)albertleao Wrote: This is very easily done by creating your own library

With your logic I can write my own framework as well..

This forum is to discuss future ideas..
Best VPS Hosting : Digital Ocean
Reply

#4
(04-06-2015, 11:32 PM)sv3tli0 Wrote:
(04-06-2015, 10:53 PM)albertleao Wrote: This is very easily done by creating your own library

With your logic I can write my own framework as well..

This forum is to discuss future ideas..

Sorry, I could have been more clear.

I just think that inputer filtering and form validation will be very application dependent.
Reply

#5
Our current input filtering and validation system does work...  That said, it could be made less intimidating and easier to use.  This could be helped by expanding and clarifying the sections in the User Guide (Great Document! but a work in progress).  I do not think a total re-write is needed.
CI 3.1 Kubuntu 19.04 Apache 5.x  Mysql 5.x PHP 5.x PHP 7.x
Remember: Obfuscation is a bad thing.
Clarity is desirable over Brevity every time.
Reply

#6
I'm with albertleao on this one. CI is a set of building blocks to build your application the way you want. All we need for form validation is already available. I'm not saying it can't be improved, but it certainly not need to be rewritten from scratch. Also, in my opinion, creating a class for every form in an application is overkill.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
Reply

#7
(04-06-2015, 10:08 PM)sv3tli0 Wrote: I think that we have to create, new solution for Form validation and filtering.
At the moment Controllers take a huge amount of code only for validating forms which is not very right. 

i agree -- so put your form validation in a model  Cool
(and use an array for the validation rules versus writing it out line by line)
Reply

#8
interesting. . So you think that filling controller with form rules and callback methods is right ?
Best VPS Hosting : Digital Ocean
Reply

#9
What cartalog said...
Move it to the model.
CI 3.1 Kubuntu 19.04 Apache 5.x  Mysql 5.x PHP 5.x PHP 7.x
Remember: Obfuscation is a bad thing.
Clarity is desirable over Brevity every time.
Reply

#10
(04-08-2015, 08:12 AM)sv3tli0 Wrote: interesting. . So you think that filling controller with form rules and callback methods is right ?

No, that will make for fat controllers. But like I suggested before. You could create a class for a form if you'd like and import that class. You could also push validation to the model.

Like IncludeBeer said before, the form validation in CI is pretty good right now. There could be some improvements (some additional rules would be nice), but you can already extend your form validation class for that. 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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