![]() |
Content positioning problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Content positioning problem (/showthread.php?tid=30681) |
Content positioning problem - El Forum - 05-22-2010 [eluser]Unknown[/eluser] Hi, new to CI and running into a strange issue. Any content I try to load is inserted at the very top of the page, above the doctype. Here's the controller: Code: <?php Here's the class I'm calling for content: Code: <?php Is this my mistake or is it a known quirk? Any help is greatly appreciated. Content positioning problem - El Forum - 05-22-2010 [eluser]marcin_koss[/eluser] In your Model class you're echoing the content. Instead you're supposed to assign that data to some variable and return it. Then in controller you would assign it to $data['result'] = $this->Db->getContent("Home"); In your view file use echo $result wherever you want it to appear. Code: function index() Check the User Guide and the introductory movies that are available on CI website Content positioning problem - El Forum - 05-22-2010 [eluser]Unknown[/eluser] Thanks, I'd read most of the manual but somehow missed the dynamic data in views bit. |