Codeigniter: Helpers, Plugins and Libraries

Wednesday, December 3rd, 2008

Codeigniter JigsawHaving used Codeigniter for a few months now, this framework is really turning out to be a joy. My last post, I talked about how to modify native CI Libraries.

With so many published PHP classes and functions, it would be a shame if we couldn’t use them in CI. Fortunately CI (like all good frameworks) provides not one but three ways to integrate 3rd code, by using Helpers, Plugins and Libraries.

(more…)

CodeIgniter: Extending the native ‘Model’ and make it your own.

Friday, November 7th, 2008

Today I took advantage of CodeIgniter’s ability to extend the native libraries, and I was well satisfied that it just works.

Let me elaborate, I’m in the process of creating models for my CI project, and realized that certain functions within the models were getting repetitive. Using CI’s ability to create my own custom libraries, I was able to create my own custom ‘Model’ which extends from the core ‘Model’ object. How this simple architecture has cleaned up my code is simply remarkable.

So read on…
(more…)

CodeIgniter: Organizing views simply

Wednesday, October 22nd, 2008

Having been brought up developing PHP using templating systems like Smarty, I’m very used to segmenting my page elements into reusable block, and swapping out blocks of HTML codes, nesting blocks of code within other blocks and so on.

Trying my hands at using CodeIgniter, one of the first obstacles I had was how to organize my ‘blocks’ on a page. Without knowing any better, I thought I had to reiterate the same view calls in every function within the controller, making the controller codes very messy.

It turns out that CodeIgniter allows us to nest views within views, and that has made things a lot simplier for me.

(more…)

Google