Site with different layout structures |
[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
[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-gui...aries.html Quote:Naming Conventions
[eluser]explores[/eluser]
Thanks, I got it working. I didn't have the naming convention correct. Thank You very much. |
Welcome Guest, Not a member yet? Register Sign In |