Welcome Guest, Not a member yet? Register   Sign In
Layout Library
#1

[eluser]Unknown[/eluser]
I just created a really simple, but flexible library that lets you use template files (a little like Zend layouts).

The library allows you to create view templates, reuse the code in your views, and to make views modular. You can have a different view for each section of a page, and reuse those sections in different page types. Create multiple templates for different page types, email headers and footers, .csv files etc.

And it's super easy to use:

1. Add Layout.php to your libraries folder
2. Load the library in your controller: $this->load->library('layout');
3. Create a layout file at /application/views/templates/layout.phtml
4. Echo $layout_content in your layout file.
5. Call $this->layout->render($views)
6. Navigate to the page and watch the magic happen

You can find the source code at https://github.com/geoffreyburdett/CI_Layout

Any and all [constructive] feedback is very welcome and appreciated!
#2

[eluser]Flemming[/eluser]
Looks interesting, thanks for sharing! I've downloaded from Github and will have a play with it when I get a bit of spare time! :-)
#3

[eluser]Unknown[/eluser]
Thanks, it's my first CI code library, so I'd love some insight.




Theme © iAndrew 2016 - Forum software by © MyBB