• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A simple Template library

#1
[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

#2
[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);
rather, only this method is supported:
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 !!

#3
[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 Smile

By the way, nice website! I usually don't like Flash very much, but you use it in such an unobstructive way!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.