Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Template system in CodeIgniter like wordpress?

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.

like image 910
Christophe Avatar asked Feb 25 '10 08:02

Christophe


People also ask

How to view page in CodeIgniter?

To load (and display) a view in CodeIgniter, we use the built in Loader library. $this ->load->view( 'hello_world' , $data , true/false); This single line of code will tell CodeIgniter to look for hello_world. php in the application/views folder, and display the contents of the file in the browser.


1 Answers

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.

like image 110
Phil Sturgeon Avatar answered Nov 17 '22 14:11

Phil Sturgeon