Welcome Guest, Not a member yet? Register   Sign In
Extending validation and how to use it
#1

[eluser]moleculezz[/eluser]
Hello,
I am new with CI and I don't quite understand how extending libraries work and I have a few questions.

1. What is the difference between the libraries "Form_validation and Validation". The reason I ask is because I found in the wiki an example of an extended version of validation and this extends "Validation".
I have been using "$this->load->library('form_validation');" in my controllers and not "validation". Can someone explain the difference?

2. In the wiki example they extend the "validation" library.
Should I instead extend "Form_validation" library since I have been loading "Form_validation" in controllers?

Tnx!
#2

[eluser]vickel[/eluser]
As I found out: form_validation is the new CI 1.7.2 class to Validate a Form, while validation is the older one... just replace it in the wiki code
#3

[eluser]moleculezz[/eluser]
I also found the class "Form_validation" in CI 1.7.1.
Are you sure about your findings?
#4

[eluser]pistolPete[/eluser]
Just read the user guide: http://ellislab.com/codeigniter/user-gui...ation.html
Quote:Note: As of CodeIgniter 1.7.0, this Form Validation class supercedes the old Validation class, which is now deprecated. We have left the old class in the library so applications currently using it will not break, but you are encouraged to migrate to this new version.

You should use and extend the Form Validation class.
Which extension in the wiki are you referring to?
#5

[eluser]moleculezz[/eluser]
I understand. Thank you for the information.

This is the wiki page:
wiki (MY Validation)




Theme © iAndrew 2016 - Forum software by © MyBB