views:

43

answers:

0

Previously using Ocular 0.25 I was able to set an object as a view data, that I could access in the view: like:

$b= new book(); $b->get_where("id",5); 
$this->ocular->set_view_data("b", $b);

    //could be accessed in view as $b

but in the new Ocular 1.0.1, when I try to set a data mapper object it gives me a blank screen, without any error. I can't create an object in the view and its not even logical and good MVC but I can't set the object in the controller function.

$b= new book(); $b->get_where("id",5);

$this->ocular->set("b", $b); //causes a blank screen no errors nothing but blank screen

//but if I do. $b = "test"; 
$this->ocular->set("b", $b); //This works fine

//in the view 
$b = $this->ocular->get("b"); //is not possible.

Can anyone help me with the solution, I am using Ocular 1.0.1 and Data Mapper 1.5.4 but I am not able to load an object in the view.