Welcome Guest, Not a member yet? Register   Sign In
Template Library Version 1.2.1
#11

[eluser]Milos Dakic[/eluser]
One more question Colin, were you looking at adding support for Smarty in this? Or how hard would be be to add support for Smarty?

I would very much like to use your library, but at this point in time I'm looking to use a template engine as the Parser library that comes with CI is not adequate enough for what I'm trying to do.

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?
#12

[eluser]Colin Williams[/eluser]
Quote: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:

Code:
$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)

Quote: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.
#13

[eluser]Milos Dakic[/eluser]
[quote author="Colin Williams" date="1218466720"]
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.[/quote]

Maybe that isn't such a bad idea. Got an idea of how it could be done.
Config file:
Code:
$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
#14

[eluser]Colin Williams[/eluser]
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.
#15

[eluser]Milos Dakic[/eluser]
Great! Let me know if you need help testing or anything else.
#16

[eluser]Unknown[/eluser]
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
#17

[eluser]murphy2006[/eluser]
Please give examples how to get content from a database.
#18

[eluser]Colin Williams[/eluser]
http://ellislab.com/codeigniter/user-gui...index.html

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

[eluser]BaRzO[/eluser]
Thank you very much Colin
ill bookmark this page for updates...
#20

[eluser]Colin Williams[/eluser]
[url="http://ellislab.com/forums/viewthread/88393/"]Template 1.3 has been released[/url].




Theme © iAndrew 2016 - Forum software by © MyBB