Welcome Guest, Not a member yet? Register   Sign In
passing an argument to a library constructor doesn't work anymore with ci 1.7 :(
#3

[eluser]Unknown[/eluser]
I also ran into this change when upgrading to 1.7.

Using 1.6.3 I had the following, where $this->website is a string.

Code:
$this->CI->load->library('fp_create_database',$this->website);

Code:
function __construct($dbname) {
        parent::__construct();

        $dbname = split(':',$dbname);
        $this->dbname = $dbname[0];
        
}

Using 1.7 I had to change the code to pass in an array.

Code:
$this->CI->load->library('fp_create_database',array('dbname' => $this->website));

Code:
function __construct($dbname) {
        parent::__construct();

        $dbname = split(':',$dbname['dbname']);
        $this->dbname = $dbname[0];
        
}

Documentation states that
Quote:The second parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

I could also not find anything in the Changelog referring to this change. Got me so I hope this post helps those with the same issue.

Thanks MJ


Messages In This Thread
passing an argument to a library constructor doesn't work anymore with ci 1.7 :( - by El Forum - 11-04-2008, 02:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB