$this->
loadRuleGroup($group);
// If no rules exist, we return false to ensure
// the developer didn't forget to set the rules.
if (empty($this->rules
)) { return false;
} // Replace any placeholders (e.g. {id}) in the rules with
// the value found in $data, if any.
$this->rules =
$this->
fillPlaceholders($this->rules,
$data);
// Need this for searching arrays in validation.
helper('array'
);
// Run through each rule. If we have any field set for
// this rule, then we need to run them through!
foreach ($this->rules
as $field =>
$setup) { $rules =
$setup['rules'
];
if (is_string($rules)) { $rules =
$this->
splitRules($rules);
}