If I have a callback function within MY_Controller that processes a form :
class MY_Controller extends CI_Controller{
function login(){
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() == true){
//do something
}
}
}
How should I go about referencing it with a form helper in my view?
echo form_open('?/login');
The reasoning behind this is that we have a login form within a header template that doesn't have a corresponding controller, it's being loaded before each view. We are hiding the login form with JS if session data is set, so it seems most logical to place the callback within MY_Controller, I'm just unsure how to access it with the form helper class. Any suggestions?