• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form validation by my own method

#1
Hello all!

I have a very simple task, but I can't make this :-( I have to check login and password in the database. So I have simple web form with two fields: login and password. I have a controller with rules:
PHP Code:
$rules = array(
    array(
    
"field" => "login",
    
"label" => "Username",
    
"rules" => array("trim""required", array("is_accessable", array($this->users"get_access"))),
    ),
    array(
    
"field" => "password",
    
"label" => "Password",
    
"rules" => "trim|required",
    ),
);
$this->form_validation->set_message("is_accessable""Wrong login and password."); 

And I have the model Users with the method get_access. But this method takes two parameters (login, password).

The question is, how can I pass second parameter to method get_access()?

Thank you very much in advance!

P.S.: Sorry for my English.
Reply


Messages In This Thread
Form validation by my own method - by Valery - 04-25-2015, 09:07 AM
RE: Form validation by my own method - by Valery - 04-28-2015, 04:20 AM
RE: Form validation by my own method - by Valery - 04-28-2015, 04:12 AM
RE: Form validation by my own method - by CroNiX - 04-28-2015, 11:33 AM
RE: Form validation by my own method - by Valery - 04-29-2015, 07:03 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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