Welcome Guest, Not a member yet? Register   Sign In
pass data to view from controller
#2

[eluser]GSV Sleeper Service[/eluser]
if $data is being declared in your constructor, then it means that $data is only available within the constructor.

you should be doing something like this -
Code:
class Foo extends Controller {

    var $data = array(); // note: delcared as a class var

    function Foo(){
        $this->data['bar'] = 'wibble';
    }
    
    function other_method(){
        ...
        $layout['body']=$this->load->view('place/user_all_places',$this->data, True);
        $this->load->view('Layout', $layout);
    }

}


Messages In This Thread
pass data to view from controller - by El Forum - 05-15-2008, 05:10 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:22 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:48 AM
pass data to view from controller - by El Forum - 05-15-2008, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB