Welcome Guest, Not a member yet? Register   Sign In
how to assign the instantiated object to a variable?
#4

[eluser]adamp1[/eluser]
But why? If its a model you want to pass just do this.
Code:
$this->load->model('my_model');

$object = new MyOtherOBject();

// MyOtherObjectDeclaration
class MyOtherObject
{
    public function __construct()
    {
        $CI = &get;_instance();

        // You now have access to the model object we created before creating this one.
    }
}


Messages In This Thread
how to assign the instantiated object to a variable? - by El Forum - 04-11-2010, 11:47 PM
how to assign the instantiated object to a variable? - by El Forum - 04-11-2010, 11:49 PM
how to assign the instantiated object to a variable? - by El Forum - 04-11-2010, 11:59 PM
how to assign the instantiated object to a variable? - by El Forum - 04-12-2010, 12:44 AM
how to assign the instantiated object to a variable? - by El Forum - 04-12-2010, 12:48 AM
how to assign the instantiated object to a variable? - by El Forum - 04-12-2010, 04:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB