Smarty integration into the CodeIgniter framework Smarty integration into the CodeIgniter framework codeigniter codeigniter

Smarty integration into the CodeIgniter framework


Sorry to resurrect an old question - but none of the answers have been flagged as "accepted" yet.

There's a library called "template" that does a great job of allowing you to use just about any template parser you want:

Template CI Library - V1.4.1

The syntax is pretty easy for integrating into your CI application and the smarty integration spot on.


Slightly OT, hope you don't mind...

I'm a Zend Framework user and I think it's worth saying that the loose coupling means you don't need to include any files you're not actively using. Hopefully this negates your concern about unnecessary overhead.

With the layouts stuff added in a recent release of ZF, its templating is really hard to fault... and it's completely pluggable as Favio mentions. The more I use ZF, the more I like it; they do things the way I would do them!


I did a quick google search and found the following:http://devcha.blogspot.com/2007/12/smarty-as-template-engine-in-code.htmlhttp://codeigniter.com/forums/viewthread/67127/

If the designer is not familiar with Smarty, I think it's almost the same as if you use the existing CodeIgniter templating system (which leaves everything to PHP actually). It also depends on the complexity of the project at hand.

You can also hook Smarty with Zend Framework. It's more complex than with CodeIgniter, but there's already a primer on how to do exactly that in the ZF documentation. http://framework.zend.com/manual/en/zend.view.scripts.html Plus lots of tutorials on the net.

In my opinion it's almost the same, you can use pure PHP or Smarty as your template "engine", so it depends on the project. Also, compare a developer who has extensive experience and already has a library of view helpers so she uses pure PHP, versus a designer who doesn't know anything about PHP, but has extensive experience with Smarty. Sometimes decisions have to be based on who is going to do what.