• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Validation Function

#1
Hi guys,

Ive created a function(MyValidation) to validate the input format.

MyValidation function is I'm the same controller as my validation. I am able to run the validation by "callback_MyFunction". withOut any issue.

Now I'm trying to bring it out of my controller(Ive created a new class in library) that i can use this for another controllers without retype in new controller.

My validation to call MyValidation from library
PHP Code:
$this->form_validation->set_rules('input''lang:''trim|required|callback_'.$this->functions->MyValidation($this->input->post('input')) ); 
Also I've tried these 2 ways
PHP Code:
$this->form_validation->set_rules('input''lang:''trim|required|callback_'.$this->functions->MyValidation ); 
PHP Code:
$this->form_validation->set_rules('input''lang:''trim|required|callback_'.$this->functions->MyValidation() ); 

Any idea?
Reply


Messages In This Thread
Custom Validation Function - by ardavan - 09-22-2015, 06:28 AM
RE: Custom Validation Function - by kilishan - 09-22-2015, 06:52 AM
RE: Custom Validation Function - by ardavan - 09-24-2015, 06:10 PM
RE: Custom Validation Function - by ardavan - 09-30-2015, 02:15 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 02:37 AM
RE: Custom Validation Function - by ardavan - 09-30-2015, 03:13 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 03:39 AM
RE: Custom Validation Function - by Martin7483 - 09-30-2015, 07:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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