Site with different layout structures - 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: Site with different layout structures (/showthread.php?tid=27504) |
Site with different layout structures - El Forum - 02-12-2010 [eluser]explores[/eluser] Hi, I am new to CI and I am trying to figure out how to setup certain pages to use a different layout, for example some pages will use a one column and others will use a two column structure. Currently I have a layout.php in the libraries folder and its set to read a layout.php in the views folder which works fine but when I try to repeat the process for the other layout I get an error message. I have searched the wiki, forum, guide, and Google but nothing I read seems like the correct solution. Any help would be great Thanks ERROR A PHP Error was encountered Severity: Notice Message: Undefined property: Port::$layout Filename: controllers/port.php Line Number: 15 libraries Folder: File: Layout_one_column CODE: Code: <?php Controllers Folder: File: port.php Code: Code: <?php Site with different layout structures - El Forum - 02-12-2010 [eluser]danmontgomery[/eluser] Code: class Layout_one_column I assume function Layout() is intended to be your construct? Code: class Layout Also: Code: $this->load->library('Layout','layout_one_column'); [edit] Just read that the library is named layout.php, the class name must match the filename. http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html Quote:Naming Conventions Site with different layout structures - El Forum - 02-12-2010 [eluser]explores[/eluser] Thanks, I got it working. I didn't have the naming convention correct. Thank You very much. |