[eluser]Unknown[/eluser]
Hi, a newbie question again. In the user guide it says that you can load a view passing an object variable to it. How do I access that object in the view?
Suppose I have the following code in my model "mymodel":
Code:
...
function get_record() {
$cond = ... // some selection criteria
$query = $this->db->get_where('mytable', $cond);
return $query;
}
And in my controller "mycontroller":
Code:
...
function retrieve() {
$results = $this->mymodel->get_record();
$this->load->view("myview", $results);
}
How should I access the query results in my view "myview"? Am I doing it right?
Thank you for your help!!