Welcome Guest, Not a member yet? Register   Sign In
Validation set_rules doesn't make sense?
#1

[eluser]xwero[/eluser]
I never given it much though but the only thing the set_rules method does is copy the array you defined in the controller/model/library to a validation internal array. This means the method only wastes resources or am i missing something?

set_rules code
Code:
function set_rules($data, $rules = '')
    {
        if ( ! is_array($data))
        {
            if ($rules == '')
                return;
                
            $data[$data] = $rules;
        }
    
        foreach ($data as $key => $val)
        {
            $this->_rules[$key] = $val;
        }
    }

It may not be a big waste but in the meanwhile there are no parameters for the run method which is the method that uses the rules.


Messages In This Thread
Validation set_rules doesn't make sense? - by El Forum - 04-15-2008, 07:38 AM
Validation set_rules doesn't make sense? - by El Forum - 04-15-2008, 07:55 AM
Validation set_rules doesn't make sense? - by El Forum - 04-15-2008, 07:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB