Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Form validation callback method in MODEL instead of controller -- Read me if you want the answer.
#3

[eluser]Mirge[/eluser]
I've also tried creating an isolated test... this also is NOT calling my callback method. Any idea why?

Code:
<?php

class MTest extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
        $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
    }
    
    public function save_data()
    {
        echo "inside save_data() - before<br/>";
        $this->form_validation->set_rules('some_field', 'Some Field', 'callback_fakefield');
        $this->form_validation->run();
        echo "inside save_data() - after<br/>";
    }
    
    public function fakefield()
    {
        echo "got here inside fake field callback function.";
        return false;
    }
}

Here's the output:

Code:
before
inside save_data() - before
inside save_data() - after
after


Messages In This Thread
[SOLVED] Form validation callback method in MODEL instead of controller -- Read me if you want the answer. - by El Forum - 08-04-2011, 04:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB