Welcome Guest, Not a member yet? Register   Sign In
Dynamic Data Objects
#1

[eluser]bastones[/eluser]
Hi,

I have the following piece of code:
Code:
else {
    $activate_now=new Activate();
        $this->load->view('login_view',$activate_now);
}

...and basically inside the view file I want to request the object? Like I would do $activate_now->function for example? Hope I explained enough Smile.

Cheers.
#2

[eluser]Aken[/eluser]
I'm pretty positive you can't pass objects through to view files. Instead, you should create an Activate library, and have it's variables returned as an array instead of an object.

Then in the view, instead of calling $activate_now->variable, you'd call $activate_now['variable']
#3

[eluser]bastones[/eluser]
sorry that doesn't make sense to me, can you elaborate?
#4

[eluser]Aken[/eluser]
Read the User Guide portion about loading dynamic content into your views: http://ellislab.com/codeigniter/user-gui...views.html
#5

[eluser]frenzal[/eluser]
I think this would work:
Code:
else {
    $data["activate_now"] =new Activate();
        $this->load->view('login_view',$data);
}

and then your object will be $activate_now




Theme © iAndrew 2016 - Forum software by © MyBB