News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Constantin Bosneaga:
Using layout pattern with CodeIgniter
October 01, 2012 @ 11:57:08

Constantin Bosneaga has a recent post to his site that the CodeIgniter users out there could find helpful. It's an example of using the Layout pattern in a CI app to make a more flexible layout thanks to a library (source included in the post).

CodeIgniter is great framework by its simplicity. But when I moved from CakePHP, I really missed layout pattern. CodeIgniter documentations offers this way to include non-changing site header and footer. For sure it isn't flexible and does not show page structure in a clear way. For many years I use layout pattern. Layout describes whole page as a template with blocks for header, menu, content, etc.

He uses this library to handle the data for your layout, including the header items (like CSS, Javascript) and the definition of a global template. It also allows you to do template inheritance, making it simpler to reuse partial templates ("blocks").

0 comments voice your opinion now!
layout designpattern codeigniter tutorial library


blog comments powered by Disqus

Similar Posts

NETTUTS.com: CodeIgniter From Scratch: Day 6 – Login

Elliot Haughin's Blog: CodeIgniter 1.7.x, 'Core' 2.0, CodeIgniter Reactor, Bitbucket, Zips...

Knut Urdalen's Blog: ORM the manual way

Edd Mann: Storing PHP Sessions/File Caches in Memory using TMPFS

DevShed: Creating a Simple Threaded Discussion Forum


Community Events











Don't see your event here?
Let us know!


podcast example install overview language facebook security application opinion package code component framework introduction unittest hhvm symfony2 composer release hack

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework