Welcome Guest, Not a member yet? Register   Sign In
Template Engine For CodeIgniter 3x
#1

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

It's fairly easy to implement other template engines.

A quick google search will show you implementations for Twig, Blade, and Smarty.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#3

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
Reply
#4

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:
Reply
#5

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/codeignite...handlebars

DMyers
Reply
#6

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.
Reply
#7

(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
Reply
#8

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

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




Theme © iAndrew 2016 - Forum software by © MyBB