CodeIgniter Forums
Template Engine For CodeIgniter 3x - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Template Engine For CodeIgniter 3x (/showthread.php?tid=65674)



Template Engine For CodeIgniter 3x - marcusmann - 07-10-2016

You can have a template engine? FULL with for, while, etc ... ?
Thanks


RE: Template Engine For CodeIgniter 3x - albertleao - 07-11-2016

It's fairly easy to implement other template engines.

A quick google search will show you implementations for Twig, Blade, and Smarty.


RE: Template Engine For CodeIgniter 3x - dmyers - 07-11-2016

I agree with albertleao 100%. There are so many easy to implement template engines already out there for PHP I don't feel it's a great use of the CodeIgniter resources.

If you like the CI one this one is pretty close https://github.com/pyrocms/lex

I personally have been using Handlebars http://handlebarsjs.com for PHP https://github.com/zordius/lightncandy which allows me to use the same style templates for my Javascript work as well. That library actually complies the template into raw PHP which makes it pretty darn fast.

DMyers


RE: Template Engine For CodeIgniter 3x - dsv - 07-11-2016

If you're looking for a simple and easy way to implement Twig Template Engine in your project (by CodeIgniter version):

CI 2.x:

CI 3.x:


RE: Template Engine For CodeIgniter 3x - dmyers - 07-12-2016

I whipped this CodeIgniter Parser example using both lex and handlebars in about an hour.

This should be enough to get you headed in the right direction with any Parser.

https://github.com/dmyers2004/codeigniter-lex-handlebars

DMyers


RE: Template Engine For CodeIgniter 3x - jeffersonlicet - 08-15-2016

Hi, i'm using Twig for Codeigniter 3.0 from (https://github.com/kenjis/codeigniter-ss-twig). also i implemented my own Theme System. A great combination.


RE: Template Engine For CodeIgniter 3x - danangeloalcanar - 04-27-2018

(08-15-2016, 03:04 PM)jeffersonlicet Wrote: Hi, i'm using Twig for Codeigniter 3.0 from (https://github.com/kenjis/codeigniter-ss-twig). also i implemented my own Theme System. A great combination.

Hi jefferson,

I have a simple question, hope you can help me. How can I use session flashdata in CodeIgniter using Twig?

I am doing a page redirect so I need to save a temporary message.

Cheers
-Dan


RE: Template Engine For CodeIgniter 3x - felixaf21 - 04-27-2018

Blade like:
https://github.com/GustMartins/Slice-Library


RE: Template Engine For CodeIgniter 3x - vincent78 - 05-02-2018

I've created a Template/Layout Engine Library (compatible with CI2 and CI3)
You can find it here : CodeIgniter Layout Library