A simple Template library |
[eluser]Jérôme Jaglale[/eluser]
I was quite frustrated with the wiki's template libraries: difficult to use, not well documented, and not very readable source code. PHP and CodeIgniter are so simple, we also need a simple template system without having to learn yet another framework! :-) Here comes this Template "library": 3 lines (no kidding!), easy to understand and upgrade to match your needs. Give it a try and let me know what do you think of it! I tried to put it on CI's wiki, but I eventually gave up. Here's a direct link (doc + code): Templates with CodeIgniter
[eluser]exodus7[/eluser]
Jérôme: I wanted to say thanks for a job well done. I really like the way it works - I just have 1 issue with it - I like to keep my templates in sub-folders in the view folder but the current code will not allow you to do something like this: Code: $this->template->load('templates/mainTemplate', 'locations/main', $data); Code: $this->template->load('mainTemplate', 'locations/main', $data); Are there any future plans to add this feature, or is there a way to make it work? Thanks again for your contributions to CI !!
[eluser]Jérôme Jaglale[/eluser]
Exodus7: Thank you, I'm glad you like this tiny library. I integrated the modification suggested by Jram, so you can now put your templates in sub-folders By the way, nice website! I usually don't like Flash very much, but you use it in such an unobstructive way! |
Welcome Guest, Not a member yet? Register Sign In |