I recently did a similar thing with Cgiapp2's use of templates by separating templates to a plugin layer and creating a template interface. To implement the interface, you simply implement three methods, init(), assign(), and fetch(). Those three methods pretty much define the API of any templating solution I've used, and I delivered Smarty, Savant2 and 3, and XSLT in the distribution.
If you add in an additional method for returning the actual engine instance, you then have access to modify it -- for instance, to register modifiers in Smarty, or filters and helpers in Savant.
The code is licensed under the BSD -- feel free to take a look at it and see if it may fit the needs of Serendipity; with it, you may be able to provide additional templating solutions to fit the needs of other developers.
judas_iscariote am um :
Garvin, Why reinventing the wheel ?
I think the vast mayority of your users don't care about a few miliseconds or a tiny amount of RAM, hardware is cheap after all.
Well, if you read the whole posting, you know why. :-))
A person requested it, I implemented it. It took no time, it is a perspective for PHP users. It does not hurt. It was fun. That's what OpenSource is about, right?
Thanks a lot for telling me about this. I'll have a look at that and see if there is a common crossing to work on. Many thanks for sharing and best regards,
Garvin.
Arnaud am um :
To the extent that you do not have too many people reading your blog and are not hosted on a shared host where resources used are important.
pacoit am um :
Has anyone considered phpTAL templating system? It's very nice, and editor-friedly (though I don't use graphical html editors).
http://phptal.motion-twin.com/
Matthew Weier O'Phinney am um :
I recently did a similar thing with Cgiapp2's use of templates by separating templates to a plugin layer and creating a template interface. To implement the interface, you simply implement three methods, init(), assign(), and fetch(). Those three methods pretty much define the API of any templating solution I've used, and I delivered Smarty, Savant2 and 3, and XSLT in the distribution.
If you add in an additional method for returning the actual engine instance, you then have access to modify it -- for instance, to register modifiers in Smarty, or filters and helpers in Savant.
The code is licensed under the BSD -- feel free to take a look at it and see if it may fit the needs of Serendipity; with it, you may be able to provide additional templating solutions to fit the needs of other developers.
judas_iscariote am um :
Garvin, Why reinventing the wheel ?
I think the vast mayority of your users don't care about a few miliseconds or a tiny amount of RAM, hardware is cheap after all.
Sorry, but I just don't get it.
Garvin am um :
Hi Judas!
Well, if you read the whole posting, you know why. :-))
A person requested it, I implemented it. It took no time, it is a perspective for PHP users. It does not hurt. It was fun. That's what OpenSource is about, right?
Best regards, Garvin
Garvin am um :
Hi Matthew!
Thanks a lot for telling me about this. I'll have a look at that and see if there is a common crossing to work on. Many thanks for sharing and best regards, Garvin.
Arnaud am um :
To the extent that you do not have too many people reading your blog and are not hosted on a shared host where resources used are important.
pacoit am um :
Has anyone considered phpTAL templating system? It's very nice, and editor-friedly (though I don't use graphical html editors). http://phptal.motion-twin.com/