Part of the EllisLab Network
   
2 of 2
2
Template Library Version 1.2.1
Posted: 11 August 2008 04:58 AM   [ Ignore ]   [ # 11 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

were you looking at adding support for Smarty in this? Or how hard would be be to add support for Smarty?

Not anything I had considered. Template is currently only a compliment and interface to CI, so it can do only what CI can do at a low level. I also don’t particularly like or use templating languages like Smarty, and I only interfaced with the Template Parser class because it was dead easy to do. If you point me at a good Smarty parser and propose an API for it within Template ($this->template->write_smarty() maybe?), I’d be more than happy to implement it.

Alternatively, you can just parse Smarty separately from Template and write the results with Template:

$text = parse_smarty('smarty_file.php', $data);
$this->template->write('content', $text);

Your master template would still need to be PHP (couldn’t even be Template Parser syntax.. something I will address in the next release)

If I do choose to use your library, it will be used for a commercial project that I have been planning to make for some time now. Are you fine with that?

The CodeIgniter License prohibits Template from being licensed on its own (because it relies on the CI codebase). So, you are only bound by the CodeIgniter license when using Template. Have at it.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 11 August 2008 05:17 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  131
Joined  06-06-2008
Colin Williams - 11 August 2008 04:58 AM

Not anything I had considered. Template is currently only a compliment and interface to CI, so it can do only what CI can do at a low level. I also don’t particularly like or use templating languages like Smarty, and I only interfaced with the Template Parser class because it was dead easy to do. If you point me at a good Smarty parser and propose an API for it within Template ($this->template->write_smarty() maybe?), I’d be more than happy to implement it.

Maybe that isn’t such a bad idea. Got an idea of how it could be done.
Config file:

$config['parser'] = 1;
/* 0 being CI templates, 1 being Smarty. */

For the reason that, when implementing and looking to introduce Smarty into your library it wouldn’t take long as it could be all done from one function which defines the settings or methods that need to be called. Or even your end result depending on the config file.

Don’t know if this makes any sense but I guess I’ll find out soon. smile

 Signature 

Milos Dakic
JustHost - world class hosting
Library: Events Library

Profile
 
 
Posted: 11 August 2008 05:26 AM   [ Ignore ]   [ # 13 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

Yep, Milos, already heading that route. There are already two parsers, PHP (Views) and CI’s Template Parser class. It’s just a matter of implementing more. I’ll let you know when I have a more concrete idea.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 11 August 2008 05:32 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  131
Joined  06-06-2008

Great! Let me know if you need help testing or anything else.

 Signature 

Milos Dakic
JustHost - world class hosting
Library: Events Library

Profile
 
 
Posted: 11 August 2008 07:22 AM   [ Ignore ]   [ # 15 ]  
Summer Student
Total Posts:  1
Joined  08-11-2008

Great Library !! it seems to be an eficient and elegant way to handle sub-view .. and quite intuitive too. Good Job and thanks for sharing
Raoul

Profile
 
 
Posted: 12 August 2008 02:44 AM   [ Ignore ]   [ # 16 ]  
Grad Student
Rank
Total Posts:  86
Joined  12-28-2005

Please give examples how to get content from a database.

Profile
 
 
Posted: 12 August 2008 02:51 AM   [ Ignore ]   [ # 17 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

http://codeigniter.com/user_guide/database/index.html

Template has nothing to do with your database. I have linked to the CI user guide documentation covering the Database libraries above.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 16 August 2008 05:53 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  78
Joined  02-13-2008

Thank you very much Colin
ill bookmark this page for updates…

 Signature 

Sorry for my pour english :(

Profile
 
 
Posted: 16 August 2008 06:27 PM   [ Ignore ]   [ # 19 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

Template 1.3 has been released.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
   
2 of 2
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120406 Total Logged-in Users: 30
Total Topics: 126511 Total Anonymous Users: 2
Total Replies: 665248 Total Guests: 339
Total Posts: 791759    
Members ( View Memberlist )