Author Topic: Changing vars of parent class?  (Read 737 times)

0 Members and 1 Guest are viewing this topic.

Offline amitesTopic starter

  • Enthusiast
  • Posts: 247
    • View Profile
    • Mites Media Creations
Changing vars of parent class?
« on: December 25, 2008, 07:49:13 AM »
Hello,

I am attempting to build a function to add multiple arrays to a class var, I am attemting to do this from within an extension of that same class,

the following is Code Igniter code with comments, it sets $this->_form_data properly trick is that it is loaded into a seperate object
Code: [Select]

class MultiValid extends CI_Form_validation {
    function multi_rules($group = '') {

// Loads the array
        $this->CI->config->load('form_validation', TRUE);
        $rules = $this->CI->config->item('form_validation');
       
        $set = false;
        if (is_array($group)) {
            foreach ($group as $grp) {
               
                if ($grp != '' && isset($rules[$grp])) {
                   
                    $this->set_rules($rules[$grp]);
                    $set = true;
                }
            }
        }
       
        return $set;
    }
}

This code is loaded as $this->multidataa
which fills $this->multidata->_form_data with values

what I'd like to set is $this->form_validation->_form_data
as it is a native library to CI and referenced regularly through other classes

any ideas?