views:

360

answers:

2

I'm trying to build a template system in CodeIgniter like wordpress. Does anyone have some links or tips to share with me on this matter?

I would like to create several functions that I can call from those php template pages like in wordpress. For example to display the comments from an item or loop through something, or even a tag_could.

the views folder would containt the different template folders & files.

and yes there is smarty, but no I don't want to use it.

+6  A: 

Have a look at my Template library. It supports modules, themes, partials and layouts so you can create one main layout for each theme then have modular views if you wish.

While you are not a fan of Smarty, you might be interested in trying Dwoo. They are both very similar but Dwoo has the advantage of not sucking major donkey balls, which is Smarty's main downfall. I have written an extension for the CodeIgniter Parser library to get it to use Dwoo, which integrates perfectly with my Template library.

Between the two you can make pretty powerful, theme-able MVC applications.

Phil Sturgeon
one up on phil's ive based my own off his and its worked great
Tom Schlick
Mine not good enough for you Tom? heh :-p If you feel like contributing the changes back I am always happy to merge or accept github forks.
Phil Sturgeon
thanks :D I'm using the template library that sylvio posted because he commented sooner and I allready jumped into the code but after looking at the link you provided I'll make sure to have a look at your template library as well and see which one works better as I will be selling this script I'm making I need it to be easy to customize.many thanks for your response
krike
+2  A: 

Check out

http://www.williamsconcepts.com/ci/codeigniter/libraries/template/index.html

Template is right for you if:

  • You feel like using views can be clunky, especially when "embedding" views.
  • You don't like calling header, footer, and other global views from every Controller method.
  • You prefer having one "master template" that can be changed for any controller in order to meet unique application design needs.
  • You don't want to drastically alter the way you interface controllers and views.
  • You like clear, thorough documentation on par with CodeIgniter's User Guide.
Sylvio