amites Posted December 25, 2008 Share Posted December 25, 2008 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 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? Quote Link to comment https://forums.phpfreaks.com/topic/138383-changing-vars-of-parent-class/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.