![]() |
Problem with the view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Problem with the view (/showthread.php?tid=30364) |
Problem with the view - El Forum - 05-12-2010 [eluser]RobertB.[/eluser] Hello, I'm having a problem showing only one of my fields (active) in the view. MODEL Code: function getCategories() CONTROLLER Code: function index() VIEW Code: <?php If I print_r($data['categories']) I can see it there with the count but for some reason does not display in the view Part of print_r($data['categories']) Code: Array ( [0] => stdClass Object ( [id] => 2 [category] => Arts & Entertainment [active] => 13 [permalink] => arts-entertainment [cat_id] => 2 ) [1] => stdClass Object ( [id] => 3 [category] => Attorneys & Legal Services [active] => 0 [permalink] => attorneys-legal-services [cat_id] => 3 ) It was working before I made some changes and one of the changes were I change the database engine to MyISAM I hope this have nothing todo with it. Thanks. Problem with the view - El Forum - 05-12-2010 [eluser]n0xie[/eluser] What does this output: Code: <ul class="<?=$class?>" id="category"> Problem with the view - El Forum - 05-12-2010 [eluser]RobertB.[/eluser] Code: <?=$category->active?> The ones that have records in it returns 0 and the ones that does not nothing. Is very strange because it is returning a count in the print_r. Is not passing from the controller to the view. Problem with the view - El Forum - 05-12-2010 [eluser]RobertB.[/eluser] If I print_r($categories) in the view this is what I get Code: Array ( [0] => stdClass Object ( [id] => 2 [category] => Arts & Entertainment [active] => 0 [permalink] => arts-entertainment [cat_id] => 2 ) [1] => stdClass Object ( [id] => 3 [category] => Attorneys & Legal Services [active] => [permalink] => attorneys-legal-services [cat_id] => 3) Problem with the view - El Forum - 05-12-2010 [eluser]RobertB.[/eluser] I don't know why yet but I've disable some jquery that I had on the view and it is working now. I will update this ASAP Thanks |