Welcome Guest, Not a member yet? Register   Sign In
Need help with controller and accessing object
#3

(This post was last modified: 04-02-2015, 11:24 AM by ciadmin.)

[eluser]Robert M.[/eluser]
So OK. I change it to row()
Now it jump into the if and load the view
Code:
if($data[\'query\']->col2==some_value){
$this->load->view(\'view_1\',$data);
}

in the view i try to access the values but i have some trouble with this. When i dump them i get this.
Code:
array(3) {
  [\"view\"]=>
  string(6) \"view_1\"
  [\"vars\"]=>
  array(3) {
    [\"col_1\"]=>
    string(1) \"1\"
    [\"col_2\"]=>
    string(5) \"test1\"
    [\"col_3\"]=>
    string(5) \"test2\"
  }
  [\"return\"]=>
  bool(false)
}
Now it is an array and not an object. The if statement in the conntroller works on the object but not in the view. What i make wrong.

I want to do something like this in the view.
Code:
echo $data->col1;

THX for help Wink


Messages In This Thread
Need help with controller and accessing object - by El Forum - 06-21-2007, 04:56 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 05:11 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 06:29 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 07:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB