Welcome Guest, Not a member yet? Register   Sign In
Autoloaded Classes that Receive Values During Instantiation
#13

[eluser]InsiteFX[/eluser]
Unless the Reactor Team has chnaged it Libraries are the only one that will accept an array for parameters.

You can do it with a Model if you create an Intialize method and pass the array into it.
Code:
class Model_name extends CI_Model {

    private $options = array();

    public function initalize($params = array())
    {
        $this->options = $params;
    }
}
If you look at the system/core/loader.php libraries you will see how they are doing it.

InsiteFX


Messages In This Thread
Autoloaded Classes that Receive Values During Instantiation - by El Forum - 05-24-2011, 12:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB