Re: [PHP] Re: Templating engines
Jay Blanchard wrote: [snip] and box of bending straws. [/snip] Nice. LMAO -- and now, back to the show. For those that really were looking for a xml-based templating enging, IBM's DW has one that you can download the source to. Its not PHP, but hey, its a start. Google for 'toot-o-matic'. Really. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Robert Cummings wrote: On Fri, 2005-04-29 at 23:55, Rasmus Lerdorf wrote: Robert Cummings wrote: I don't think that templates have a dependency between the number of pages using the template and an increase in the number of functions. In fact depending on the template, and the template engine, you can have 500 pages using the template and not a single function call. Including the elimination of include() and include_once() calls since if the template engine compiles to PHP it can do the includes at compile time rather than punting to PHP to do at run-time. While compiling to PHP is by far superior to the various terrible eval() and regex-based templating layers out there, it is still dog-slow compared to tight specialized PHP code. Just instantiating the base Smarty class, for example, takes a very long time. I optimized a Smarty site a while back where I got a 50% speedup by migrating the base Smarty class to C in an extension. This isn't a problem for engines that compile to PHP source that has direct hooks into the necessary data structures that will contain the data at run time. Smarty isn't one of them though :) Hey Robert -- can you give an example of one that does this? I'm just curious as I haven't seen many that do this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Sun, 2005-07-03 at 03:24, Burhan Khalid wrote: Robert Cummings wrote: On Fri, 2005-04-29 at 23:55, Rasmus Lerdorf wrote: [--SNIPPED--] This isn't a problem for engines that compile to PHP source that has direct hooks into the necessary data structures that will contain the data at run time. Smarty isn't one of them though :) Hey Robert -- can you give an example of one that does this? I'm just curious as I haven't seen many that do this. InterJinn's TemplateJinn :) The following is an example login template: -- jinn:module name=loginForm noRender=true jinn:component type=controller source=Project/modules/auth/controller.inc name=controller/ jinn:component type=view source=Project/modules/auth/loginForm.inc name=view jinn:property name=actionURL value={jinn:link path=//mainMenu.phtml}/ /jinn:component /jinn:module table border=0 cellspacing=0 cellpadding=5 jinn:render name=loginForm selector=formOpen/ tr td align=rightbLogin:/b/td tdjinn:render name=loginForm selector=userWidget//td /tr tr td align=rightbPassword:/b/td tdjinn:render name=loginForm selector=passwordWidget//td /tr tr tdnbsp;/td tdjinn:render name=loginForm selector=submitWidget//td /tr jinn:render name=loginForm selector=formClose/ /table -- The following illustrates the code produced (this is not a cache, TemplateJinn compiles the pages the webserver will actually load): -- ?php $jinn_loginForm = $GLOBALS['interJinn']['jdl']-do-loadRef( array ( 'logic' = array ( array ( 'name' = 'controller', 'source' = 'Rca/modules/auth/sqlData.inc', ), ), 'render' = array ( array ( 'name' = 'view', 'source' = 'Rca/modules/auth/loginForm.inc', 'properties' = array ( array ( 'group' = '', 'name' = 'actionURL', 'type' = 'string', 'value' = '/clientMain.phtml', ), ), ), ), ) ); ? table border=0 cellspacing=0 cellpadding=5 ?php $jinn_loginForm-render( 'formOpen' ); ? tr td align=rightbLogin:/b/td td?php $jinn_loginForm-render( 'userWidget' ); ?/td /tr tr td align=rightbPassword:/b/td td?php $jinn_loginForm-render( 'passwordWidget' ); ?/td /tr tr tdnbsp;/td td?php $jinn_loginForm-render( 'submitWidget' ); ?/td /tr ?php $jinn_loginForm-render( 'formClose' ); ? /table -- The above is a bit abbreviated, TemplateJinn supports as many levels of template inclusion as you want and the above is missing the outer tamplate that would normally provide the page's navigation and layout. Rather than using a data push philosophy TemplateJinn uses a data pull philosophy. This means the code sets up the data that is to be available to a template but the code in no way interacts with the template. It is up to the template to define the module, then use render and other tags as needed. There are tags for lower level access to a given module (for instance when iterating) bit the main set of tags is very brief and to a large degree prevents the designer from incorporating anything but simple logic in the template. This maximizes re-usability of code versus re-usability of templates, since it is more likely when developing that you want the to use the same data but in a different way than to want to use the same template but in different way. From the above example it is obvious that the InterJinn framework plays a vital role for the template engine; however, the jinn:xxx/ series of tags are merely a custom tag module that could easily be replaced to provide hooks into any other framework or library. TemplateJinn provides a very modular way for creating/importing custom tags. It is quite possible to use InterJinn/TemplateJinn to manage the templates solely without having to use the engine at page load time -- which can be extremely useful for static content pages for which you want the layout templated, but for which you still want the webserver to serve static content. I recently found the following link to be very informative about the different approaches: http://www.phpwact.org/pattern/template_view Personally I've never liked the Smarty system because it uses the push philosophy and IMHO the code should never
Re: [PHP] Re: Templating engines
Skrol 29 wrote: I just can't work with PHP the usual way. Mixing business source and interface source is something too bastard for me. Now that I know templates systems I totaly disagree to say that PHP is a Template Engine. Ok, it has some basic template features, but they are too poor to use it this way seriously. Mattias Thorslund wrote: Who says PHP itself is a template engine? I think nobody. Rasmus Lerdorf wrote: I do. [...] The approach I tend to point people at is something I have been calling a Template API. That is, when you build your application, you create a template api to go along with it. In essence you are creating a templating system for each application you write. While the Template API approach you're describing is a good solution for developing applications with Php and while it does separate business logic from design logic in some way, I would call it a modularized system rather than template system. In your example, the application organisation is templated, but the design is not nicely templated. This has probably something to do with what we expect a Template System to be. I think a good Template System for PHP should enable us to work the way we work with L4G/RAD tools. That is: - build and update the design with a WYSIWYG tool, - change the makeup of the design without coding, - change the position of the displayed data without coding, - not touch design source from the code. This way, business logic and design logic stay linked only by technical entities chosen to display sets of data (listbox, checkbox, table,...). It's possible to have such a Template Engine; there is no technical reason to not have it. It's just that the first generation of PHP Template Engines missed that. I'd like to have such a Template Engine not because I have no control over the people creating templates, but most of all because that's a very comfortable way to conceptualize and manipulate an application in edit mode. - Skrol29 www.tinybutstrong.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Mattias Thorslund a écrit : Then I wonder what makes skol29 think PHP's basic template features are too poor to be used seriously? I think PHP's basic template features are phenomenal. PHP is a nice and powerfull scripting langage oriented for Web developement. Let's look at what's it can do as a Template Engine. - place data items in a template: HTML ... ?php echo $myvar ? ... HTML - repeat a zone with data items (*): HTML ... ?php for ($i=0;$i=$iMax;$i++) { HTML ... ?php echo $myvar[$i] ? HTML ... ?php } ? - Hide or display a zone: HTML ... ?php if ($test) { ? HTML ... ?php } ? - include an external part or subtemplate: HTML ... ?php include('subtemplate.php') ? ... HTML And that's it. I think you cannot do more without coding HTML with PHP commands, which wouldn't be making a template anymore. (*) Note that FOR and FOREACH are the only way for repeating a zone of a template with basic PHP commands, and that's aleardy an algorithm. While placing locators into a template shouldn't mean coding. This is at the limit of template feature. - Skrol29 www.tinybutstrong.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Mon, 2005-05-02 at 13:02, Skrol29 wrote: Mattias Thorslund a écrit : Then I wonder what makes skol29 think PHP's basic template features are too poor to be used seriously? I think PHP's basic template features are phenomenal. PHP is a nice and powerfull scripting langage oriented for Web developement. Let's look at what's it can do as a Template Engine. - place data items in a template: HTML ... ?php echo $myvar ? ... HTML - repeat a zone with data items (*): HTML ... ?php for ($i=0;$i=$iMax;$i++) { HTML ... ?php echo $myvar[$i] ? HTML ... ?php } ? - Hide or display a zone: HTML ... ?php if ($test) { ? HTML ... ?php } ? - include an external part or subtemplate: HTML ... ?php include('subtemplate.php') ? ... HTML And that's it. I think you cannot do more without coding HTML with PHP commands, which wouldn't be making a template anymore. (*) Note that FOR and FOREACH are the only way for repeating a zone of a template with basic PHP commands, and that's aleardy an algorithm. While placing locators into a template shouldn't mean coding. This is at the limit of template feature. While I'm generally on the template side of the debate and more specifically on the use what's best for a given project side of the debate, I must argue that I see little problem with display logic in a template, and that foreach is not an algorithm as much as it is an expression. I mean sure there's some algorithm in the background to facilitate the traversal, but then there's some algorithm in the background to display these characters I've just typed and I'd hardly say I'm programming to bring this response to you :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
You also need to recognize that you are going to need presentation-layer logic. You simply can't get around that and you shouldn't confuse presentation-level logic, which can be quite complex, with the business logic behind your application. I often see people make the mistake of trying to separate their PHP code from their HTML which the article you referenced hinted at as well. Yes, I completely agree that business logic should be separated from presentation logic. Only problem I have is that from there people go on to conclude that html does not need to be sseparated from presentation logic. As far as I see It is a very good idea to keep all 3 of them separated. Bussines logic from presentation logic by proper organization and code design in php, and presentation logic from html by template engine. My main issue with general-purpose templating systems is that they always end up inventing a new language. It may start off as a subset of some other language, but eventually it turns into a new language. In Smarty, for example, you now have stuff like: They have to define markup language, (begin/end of template, free variable marker), but we are not talking about that. What usually is the problem is that template systems define its own programming language, with constrructs for loops, if's and whole other bunch of stuff to model dynamic behavior. And I agree with you that this makes diffrence between using such template system, and just php as template system much, much smaller. Where I do not agree, is that fat template syndrom is common to all template engines, and that it is inveitable. For instance my TemplateTamer, is now almost 5 years old, and it never had any sign of becomming programming language in it self, and it never will. It has a markup language of only 6 idioms: !--NAME: -- !--END: -- !--GLOBAL: -- !--USEGLOBAL: -- {VARIABLE} {#TRANSLATE} and there is no single sign of presentation logic inside html template, no ifs, no loops, no calls to the methods or functions, nada. All presentation logic is written in php, and in nicely separated logic.php file. rush -- http://www.templatetamer.com/ http://www.folderscavenger.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Wait - doesn't smarty 'compile' the php file and the tpl file into another php file. If you look into templates_c directory you find some 'compiled' templates. clive Robert Cummings wrote: On Thu, 2005-04-28 at 13:20, Ryan A wrote: On 4/28/2005 7:08:00 PM, Evert | Rooftop Solutions ([EMAIL PROTECTED]) wrote: Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. To state the obvious... the above is in actuality a flame disguised as an excuse. I use InterJinn, smarty, and PHP as template engines depending on what the client wants and how much work they want done, and how much elegance, modularity, and maintainability they want. Of the three I like smarty the least which is probably why I wrote my own engine :) Oh wait, I've also used eztemplate which by far takes the cake of horrible horrible templating. While PHP is itself usable as a templating engine, it's not what I would call clear and concise when used that way (but maybe that's because I've come across too many instances where the previous developer mixed business logic with display logic and then I had to rework the functionality which was a nightmare :). When using InterJinn I save the overhead of run-time includes incurred by using PHP as a templating engine, and I save the overhead of cache checks incurred by systems like smarty since InterJinn compiles to PHP source code and does not use a cache (although it can be set to automatically recompile pages when dependencies change). At any rate I don't generally post about InterJinn here anymore since some of the regulars tend to get annoyed ;) Mind you I don't post much at all anymore since I became a father a year and a half ago... priorities you know :) Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templating engines
Hi clive I tried all of them and I must admit smarty comes out on top by a mile I use it on a very busy virtual host and have had NO problems with slow script etc, highly recommended http://smarty.php.net pete Clive Zagno wrote: Hi all, What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
* Clive Zagno [EMAIL PROTECTED]: Wait - doesn't smarty 'compile' the php file and the tpl file into another php file. If you look into templates_c directory you find some 'compiled' templates. Yes, it does. And your question is...? If it's about performance, the compilation is not an issue. Compilation of templates into PHP code happens only when the template file changes; subsequent requests for the template then use the compiled version. This actually speeds things up tremendously. This could be interpreted as, Well, if Smarty just compiles the templates into PHP anyways, why not use PHP? And the answer is that Smarty uses a language subset -- it doesn't try to implement all of PHP, just a number of functions that are useful to template designers (like some basic logic, some loops, some data formatting for dates, truncation, etc.); this subset is easier to pick up for many HTML designers than learning PHP would be. Additionally, the way Smarty does tagging means that templates can often be tossed to an X/HTML validator without the tagging causing breakage. I'm not going to say Smarty is the best template engine out there for PHP -- I simply haven't tried enough of them. But I made a decision to use it and stick with it when I made the decision to start using templates, and I haven't regretted it. Robert Cummings wrote: On Thu, 2005-04-28 at 13:20, Ryan A wrote: On 4/28/2005 7:08:00 PM, Evert | Rooftop Solutions ([EMAIL PROTECTED]) wrote: Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. To state the obvious... the above is in actuality a flame disguised as an excuse. I use InterJinn, smarty, and PHP as template engines depending on what the client wants and how much work they want done, and how much elegance, modularity, and maintainability they want. Of the three I like smarty the least which is probably why I wrote my own engine :) Oh wait, I've also used eztemplate which by far takes the cake of horrible horrible templating. While PHP is itself usable as a templating engine, it's not what I would call clear and concise when used that way (but maybe that's because I've come across too many instances where the previous developer mixed business logic with display logic and then I had to rework the functionality which was a nightmare :). When using InterJinn I save the overhead of run-time includes incurred by using PHP as a templating engine, and I save the overhead of cache checks incurred by systems like smarty since InterJinn compiles to PHP source code and does not use a cache (although it can be set to automatically recompile pages when dependencies change). At any rate I don't generally post about InterJinn here anymore since some of the regulars tend to get annoyed ;) Mind you I don't post much at all anymore since I became a father a year and a half ago... priorities you know :) Cheers, Rob. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Fri, 2005-04-29 at 13:27, Clive Zagno wrote: Wait - doesn't smarty 'compile' the php file and the tpl file into another php file. If you look into templates_c directory you find some 'compiled' templates. I didn't say smarty wasn't compiled, only that InterJinn avoids the cache overhead incurred by smarty since InterJinn compiles to the actual page loaded by the browser, and not as smarty does... into a cache file which then needs to be loaded by the smarty engine, subsequently requiring smarty to be loaded beforehand incurring yet another overhead. Cheers, Rob. I use InterJinn, smarty, and PHP as template engines depending on what the client wants and how much work they want done, and how much elegance, modularity, and maintainability they want. Of the three I like smarty the least which is probably why I wrote my own engine :) Oh wait, I've also used eztemplate which by far takes the cake of horrible horrible templating. While PHP is itself usable as a templating engine, it's not what I would call clear and concise when used that way (but maybe that's because I've come across too many instances where the previous developer mixed business logic with display logic and then I had to rework the functionality which was a nightmare :). When using InterJinn I save the overhead of run-time includes incurred by using PHP as a templating engine, and I save the overhead of cache checks incurred by systems like smarty since InterJinn compiles to PHP source code and does not use a cache (although it can be set to automatically recompile pages when dependencies change). At any rate I don't generally post about InterJinn here anymore since some of the regulars tend to get annoyed ;) Mind you I don't post much at all anymore since I became a father a year and a half ago... priorities you know :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Clive Zagno [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I dont mind seeing php and html together, but designer generally hate it, so I would want to seperate php code from html as much as possible. if this is your objective than it could be worthwile for you to look at TemplateTamer, since it has very clean separation between those two, the designers get their html template file, and you get your .logic.php file, and it would rarely if ever happen that you edit each others file, or stomp over each oders code. In addition to that, not only that TT would separate php from html, it will also not introduce new progaming constructs in template, as many fat template systems do. rush -- http://www.templatetamer.com/ http://www.folderscavenger.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templating engines
What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. I just can't work with PHP the usual way. Mixing business source and interface source is something too bastard for me. Now that I know templates systems I totaly disagree to say that PHP is a Template Engine. Ok, it has some basic template features, but they are too poor to use it this way seriously. It would be like calling Notepad / VI / TextEdit Html Editors. I made and use TinyButStrong, because all other seems too complicated and had too much programming at the design side for me. It's mature now. It's also the only Template Engine that's really works with WYSIWYG templates. --- Skrol29 www.tinybutstrong.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On 4/29/05, Skrol 29 [EMAIL PROTECTED] wrote: It would be like calling Notepad / VI / TextEdit Html Editors. HTML is text.. so any text editor is an HTML editor by default, including vi. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Skrol 29 wrote: What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. I just can't work with PHP the usual way. Mixing business source and interface source is something too bastard for me. Now that I know templates systems I totaly disagree to say that PHP is a Template Engine. Ok, it has some basic template features, but they are too poor to use it this way seriously. Who says PHP itself is a template engine? I think nobody. What are the basic template features? However, there is a school of thought regarding templates that advocates template engines (written in, for instance, PHP) which use PHP as their template syntax, so that there is no need to invent new tags or placeholders. You could read the article I linked to before, it has examples. Actually, here's the link again: http://www.massassi.com/php/articles/template_engines/ Best regards, Mattias -- More views at http://www.thorslund.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Who says PHP itself is a template engine? I do. More importantly, Rasmus does. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Mattias Thorslund wrote: ... Who says PHP itself is a template engine? I think nobody. What are the basic template features? Variables / placeholders Looping construct(s) Conditionals A way to apply styles to text / markup However, there is a school of thought regarding templates that advocates template engines (written in, for instance, PHP) which use PHP as their template syntax, so that there is no need to invent new tags or placeholders. You could read the article I linked to before, it has examples. Actually, here's the link again: http://www.massassi.com/php/articles/template_engines/ The point of this article is that PHP is a good template engine ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Richard Lynch wrote: Who says PHP itself is a template engine? I do. More importantly, Rasmus does. What? My li'l brother does PHP? Or you mean him Lerdorf? Sorry... /Mattias -- More views at http://www.thorslund.us
Re: [PHP] Re: Templating engines
Jason Barnett wrote: Mattias Thorslund wrote: ... Who says PHP itself is a template engine? I think nobody. What are the basic template features? Variables / placeholders Looping construct(s) Conditionals A way to apply styles to text / markup So I suppose I'm just confused over what constitutes a templating engine? I was thinking that the class/tool/program/whatever that handles the templates would be the template engine. I'm aware that a PHP-as-template-template would use PHP's native syntax for variables/loops/conditionals. Then I wonder what makes skol29 think PHP's basic template features are too poor to be used seriously? I think PHP's basic template features are phenomenal. However, there is a school of thought regarding templates that advocates template engines (written in, for instance, PHP) which use PHP as their template syntax, so that there is no need to invent new tags or placeholders. You could read the article I linked to before, it has examples. Actually, here's the link again: http://www.massassi.com/php/articles/template_engines/ The point of this article is that PHP is a good template engine ;) As I saw it, the PHP class described in the article would be the template, but that's obviously a misconception on my part. What's the generic term for the template handling class, then? Cheers, Mattias -- More views at http://www.thorslund.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Mattias Thorslund wrote: Skrol 29 wrote: What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. I just can't work with PHP the usual way. Mixing business source and interface source is something too bastard for me. Now that I know templates systems I totaly disagree to say that PHP is a Template Engine. Ok, it has some basic template features, but they are too poor to use it this way seriously. Who says PHP itself is a template engine? I think nobody. I do. It comes down to whether you want the delineation between the template and the business logic enforced by the system or not. PHP is a general-purpose templating system that does not enforce this delineation. It lets you choose exactly how much logic you are going to allow in your templates. If you have no control over the people creating your templates, that may not be appropriate, but in many cases it is perfectly fine. It just takes a bit of discipline to use it correctly. You also need to recognize that you are going to need presentation-layer logic. You simply can't get around that and you shouldn't confuse presentation-level logic, which can be quite complex, with the business logic behind your application. I often see people make the mistake of trying to separate their PHP code from their HTML which the article you referenced hinted at as well. The approach I tend to point people at is something I have been calling a Template API. That is, when you build your application, you create a template api to go along with it. In essence you are creating a templating system for each application you write. For example, I describe a simple such system here: http://talks.php.net/show/mtladv05/20 To me, this is a perfectly good template (from the slide): ?php start_poll(1); $os = array(FreeBSD,Linux,OSX,Windows,Other); ? p class=purpose Please answer a couple of questions for us. /p p class=question 1. What is your name? /p ?php text_answer('name',64)? p class=question 2. Which operating systems do you use on a daily basis? /p ?php select_any_of($os)? p class=question 3. Which operating system do you prefer? /p ?php select_one_of($os)? ?php end_poll(); ? The end_poll() call could be eliminated as well to make it slightly cleaner, but otherwise this is straight-forward with no mixing of business-logic and content. My main issue with general-purpose templating systems is that they always end up inventing a new language. It may start off as a subset of some other language, but eventually it turns into a new language. In Smarty, for example, you now have stuff like: {object-method p1=arg1 p2=$arg2 assign=output} Result was {$output} I fail to see how this is in any way better/easier/superior to: ?$output = $object-method(arg1,$arg2)? Result was ?=$output? As far as I am concerned you shouldn't be dealing with any sort of objects from a template to begin with. There should be nothing but simple variables and straight function calls from a template, but this is a religious issue that people will never agree on. Hence PHP's neutral approach where the exact templating delienation is left up to the users. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Rasmus Lerdorf wrote: Mattias Thorslund wrote: Who says PHP itself is a template engine? I think nobody. I do. It comes down to whether you want the delineation between the template and the business logic enforced by the system or not. PHP is a general-purpose templating system that does not enforce this delineation. That explanation is sensible enough. [skipping ahead a little] The approach I tend to point people at is something I have been calling a Template API. That is, when you build your application, you create a template api to go along with it. In essence you are creating a templating system for each application you write. For many projects, I think the approach you describe in the example (below) is appropriate. One nice thing is that output can begin before the whole page has been nearly processed. I don't know if many other templating solutions can do that. To me, it looks like it would be hard to keep the functions that are called by the template to a reasonable format or number, at least in a larger project. If it's a template that is to be used by many kinds of pages, there would be either a large number of functions, or there would be generic functions that need to do different things based on the situation. Of course, the functions could become methods of a page object. Then, it gets easy to create specialized subclasses of page objects which can respond differently to the same generic method call. Sounds more attractive the more I think about it :-) Then again, if I need a big object to handle the business logic (and dynamic presentation logic) because my template approach is sequential, it might be a toss-up compared to using sequential business logic and a small template object. For example, I describe a simple such system here: http://talks.php.net/show/mtladv05/20 To me, this is a perfectly good template (from the slide): ?php start_poll(1); $os = array(FreeBSD,Linux,OSX,Windows,Other); ? p class=purpose Please answer a couple of questions for us. /p p class=question 1. What is your name? /p ?php text_answer('name',64)? p class=question 2. Which operating systems do you use on a daily basis? /p ?php select_any_of($os)? p class=question 3. Which operating system do you prefer? /p ?php select_one_of($os)? ?php end_poll(); ? The end_poll() call could be eliminated as well to make it slightly cleaner, but otherwise this is straight-forward with no mixing of business-logic and content. My main issue with general-purpose templating systems is that they always end up inventing a new language. Except the class described in the article I was talking about. It uses PHP as the template language. It's a big reason why I find it attractive. [skipping discussion on Smarty] As far as I am concerned you shouldn't be dealing with any sort of objects from a template to begin with. This does place some demands on the business logic. There should be nothing but simple variables and straight function calls from a template, but this is a religious issue that people will never agree on. Hence PHP's neutral approach where the exact templating delienation is left up to the users. No doubt, people will continue to argue over it for a long time to come. I try not to be religious about it, I simply want to know as many sides of the issue as possible. Best, Mattias -- More views at http://www.thorslund.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
* Rasmus Lerdorf [EMAIL PROTECTED] : My main issue with general-purpose templating systems is that they always end up inventing a new language. It may start off as a subset of some other language, but eventually it turns into a new language. In Smarty, for example, you now have stuff like: {object- method p1=arg1 p2=$arg2 assign=output} Result was {$output} I fail to see how this is in any way better/easier/superior to: ?$output = $object- method(arg1,$arg2)? Result was ?=$output? As far as I am concerned you shouldn't be dealing with any sort of objects from a template to begin with. There should be nothing but simple variables and straight function calls from a template, but this is a religious issue that people will never agree on. Hence PHP's neutral approach where the exact templating delienation is left up to the users. I thoroughly agree with you on this point. I think in some areas of Smarty development, they've gotten a little too complex, likely as a result of people getting lazy in what they send to the template and requesting new features. That said, I still use Smarty -- but I try to send it straight scalars or arrays, as you suggest above, leaving my heavy lifting in my application logic, and keep the presentation logic more lightweight. In reading The Pragmatic Programmer, I think that templating languages are an application of using metadata or a domain language. The principle here is a subset of the language -- or another language entirely that can be interpreted by the original language -- helps to contain and solve the problem. Sometimes it's easier to use the subset to describe the process than the full language. Let's face it, there's over 1000 functions in PHP; most of the time, I only need a few of those for my display logic. Using a template engine and its language helps me switch gears in my brain to thinking in terms of display instead of my application logic. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Fri, 2005-04-29 at 21:09, Mattias Thorslund wrote: Rasmus Lerdorf wrote: Mattias Thorslund wrote: Who says PHP itself is a template engine? I think nobody. I do. It comes down to whether you want the delineation between the template and the business logic enforced by the system or not. PHP is a general-purpose templating system that does not enforce this delineation. That explanation is sensible enough. [skipping ahead a little] The approach I tend to point people at is something I have been calling a Template API. That is, when you build your application, you create a template api to go along with it. In essence you are creating a templating system for each application you write. I think a problem here is when you decide to blend two projects that started out separately. With a templating system (some anyways :) you can just redefine the main layout for each page being merged into the larger project in a single centralized location. The approach described above would appear to require in depth modification of the application's template API. For many projects, I think the approach you describe in the example (below) is appropriate. One nice thing is that output can begin before the whole page has been nearly processed. I don't know if many other templating solutions can do that. Personally I find having the output ALWAYS begin after all business logic has completed to be a better choice, that way upon error (a catchable error) you can redirect the user to an info page that might state the page is temporarily unaccessible. To me, it looks like it would be hard to keep the functions that are called by the template to a reasonable format or number, at least in a larger project. If it's a template that is to be used by many kinds of pages, there would be either a large number of functions, or there would be generic functions that need to do different things based on the situation. I don't think that templates have a dependency between the number of pages using the template and an increase in the number of functions. In fact depending on the template, and the template engine, you can have 500 pages using the template and not a single function call. Including the elimination of include() and include_once() calls since if the template engine compiles to PHP it can do the includes at compile time rather than punting to PHP to do at run-time. Of course, the functions could become methods of a page object. Then, it gets easy to create specialized subclasses of page objects which can respond differently to the same generic method call. Sounds more attractive the more I think about it :-) So every time you want a small difference you subclass the main page object. Seems a lot of work and overhead for something small. What happens when you want to share functionality from one project in another without recoding or copying it? I personally prefer the modularization of custom functionality into loadable compiler modules. I find this especially convenient when an XML or XML-like template system is used that allows namespaces. Then you can just include already created functionality via module includes at compile time, and incur no overhead at run-time. Not to mention you get to skip past the whole sub-classing nightmare, although there's nothing to stop you from sub-classing a compiler module :) But at least it's more portable and re-usable. Overhead is still incurred for transformation on dynamic content, but even still if you are transforming dynamic content via the template engine you at least minimize the amount of work needing to be done at run-time. Then again, if I need a big object to handle the business logic (and dynamic presentation logic) because my template approach is sequential, it might be a toss-up compared to using sequential business logic and a small template object. For example, I describe a simple such system here: http://talks.php.net/show/mtladv05/20 To me, this is a perfectly good template (from the slide): ?php start_poll(1); $os = array(FreeBSD,Linux,OSX,Windows,Other); ? p class=purpose Please answer a couple of questions for us. /p p class=question 1. What is your name? /p ?php text_answer('name',64)? p class=question 2. Which operating systems do you use on a daily basis? /p ?php select_any_of($os)? p class=question 3. Which operating system do you prefer? /p ?php select_one_of($os)? ?php end_poll(); ? The end_poll() call could be eliminated as well to make it slightly cleaner, but otherwise this is straight-forward with no mixing of business-logic and content. This works, but now what happens when your client/boss requests that the operating system choice not be a multi-select list but rather checkboxes and those check boxes should be 3 columns wide. The convenient
Re: [PHP] Re: Templating engines
On 4/29/05, Robert Cummings [EMAIL PROTECTED] wrote: Personally I find having the output ALWAYS begin after all business logic has completed to be a better choice I agree totally. Most PHP coders I've worked around put PHP in their HTML. I am the exact opposite. I use PHP to build up my HTML and then output it at the very end of the script. I use heredoc syntax almost exclusively. Seems very clean. Drives me insane to see HTML with stuff like ?=$var? all through it. -- Greg Donald Zend Certified Engineer http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Robert Cummings wrote: I think a problem here is when you decide to blend two projects that started out separately. With a templating system (some anyways :) you can just redefine the main layout for each page being merged into the larger project in a single centralized location. The approach described above would appear to require in depth modification of the application's template API. The template api is a functional description of the backend capabilities you are exposing to the templates. They shouldn't have to change unless you are making changes to those backend capabilities. The templates themselves provide the markup and location of these various components of the application. The stack looks like this: http://talks.php.net/show/lca05/58 So if you are blending things together you will at most need to change the top two layers. I don't think that templates have a dependency between the number of pages using the template and an increase in the number of functions. In fact depending on the template, and the template engine, you can have 500 pages using the template and not a single function call. Including the elimination of include() and include_once() calls since if the template engine compiles to PHP it can do the includes at compile time rather than punting to PHP to do at run-time. While compiling to PHP is by far superior to the various terrible eval() and regex-based templating layers out there, it is still dog-slow compared to tight specialized PHP code. Just instantiating the base Smarty class, for example, takes a very long time. I optimized a Smarty site a while back where I got a 50% speedup by migrating the base Smarty class to C in an extension. So while how you want to separate your business logic from your layout and content, which to me are actually 3 levels of separation, is a religious thing, performance is not. Even though most sites don't get anywhere near the traffic of the stuff I deal with at Yahoo!, it still makes a difference whether your pages get served up in 80ns vs. 500ns. The 80ns page starts rendering right away with no latency and the whole thing has a perceptible crispness to it. This works, but now what happens when your client/boss requests that the operating system choice not be a multi-select list but rather checkboxes and those check boxes should be 3 columns wide. The convenient select_any_of() function is no longer usable and while I know you can still use PHP as the template language, it surely doesn't look as neat as the above. Now add validation error messages, javascript events, and other stuff that is usually required in a real life situation. The source starts to get difficult to read and maintain as you switch in and out of PHP, HTML, and Javascript :) You simply change the select_any_of() API function, or make another one. There are 3 levels of separation here. For large projects you have people who provide content. In this example, these are the people writing the actual polls. They are not web designers, they don't know any Javascript and next to no HTML. They simply provide the content for the application. Much like a journalist would provide content to a news site. The next layer down is the HTML/Javascript and whatever presentation layer magic you need. And finally, the 3rd layer is the business logic which is where your database calls and real meat of your application resides. In this 3rd layer there is absolutely no HTML nor Javascript. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Fri, 2005-04-29 at 23:55, Rasmus Lerdorf wrote: Robert Cummings wrote: I don't think that templates have a dependency between the number of pages using the template and an increase in the number of functions. In fact depending on the template, and the template engine, you can have 500 pages using the template and not a single function call. Including the elimination of include() and include_once() calls since if the template engine compiles to PHP it can do the includes at compile time rather than punting to PHP to do at run-time. While compiling to PHP is by far superior to the various terrible eval() and regex-based templating layers out there, it is still dog-slow compared to tight specialized PHP code. Just instantiating the base Smarty class, for example, takes a very long time. I optimized a Smarty site a while back where I got a 50% speedup by migrating the base Smarty class to C in an extension. This isn't a problem for engines that compile to PHP source that has direct hooks into the necessary data structures that will contain the data at run time. Smarty isn't one of them though :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templating engines
Clive Zagno wrote: Hi all, What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. PHP itself is a templating engine, i.e. it can be used to filter input and format it into output. But Smarty is nice if you want your people to be able to create a template without giving them all of the additional PHP coding abilities. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Templating engines
* Clive Zagno [EMAIL PROTECTED]: What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Just FYI, you've opened the door for a holy war, as temlating and template engines are a fairly volatile topic, with many people holding very extreme opinions on the subject. (me? I use Smarty.) -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:[EMAIL PROTECTED] | http://vermontbotanical.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Hi, I dont mind seeing php and html together, but designer generally hate it, so I would want to seperate php code from html as much as possible. clive Jason Barnett wrote: Clive Zagno wrote: Hi all, What templating engines do you use with php and why? Ive been using smarty (http://smarty.php.net) Clive. PHP itself is a templating engine, i.e. it can be used to filter input and format it into output. But Smarty is nice if you want your people to be able to create a template without giving them all of the additional PHP coding abilities. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ive been using smarty (http://smarty.php.net) Just FYI, you've opened the door for a holy war, as temlating and template engines are a fairly volatile topic, with many people holding very extreme opinions on the subject. (me? I use Smarty.) -- Matthew Weier O'Phinney So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) Cheers, Ryan I would go for a xml-style template engine (start flaming right below this thread) grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On 4/28/2005 7:08:00 PM, Evert | Rooftop Solutions ([EMAIL PROTECTED]) wrote: Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. :-p Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Thu, 2005-04-28 at 13:20, Ryan A wrote: On 4/28/2005 7:08:00 PM, Evert | Rooftop Solutions ([EMAIL PROTECTED]) wrote: Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. To state the obvious... the above is in actuality a flame disguised as an excuse. I use InterJinn, smarty, and PHP as template engines depending on what the client wants and how much work they want done, and how much elegance, modularity, and maintainability they want. Of the three I like smarty the least which is probably why I wrote my own engine :) Oh wait, I've also used eztemplate which by far takes the cake of horrible horrible templating. While PHP is itself usable as a templating engine, it's not what I would call clear and concise when used that way (but maybe that's because I've come across too many instances where the previous developer mixed business logic with display logic and then I had to rework the functionality which was a nightmare :). When using InterJinn I save the overhead of run-time includes incurred by using PHP as a templating engine, and I save the overhead of cache checks incurred by systems like smarty since InterJinn compiles to PHP source code and does not use a cache (although it can be set to automatically recompile pages when dependencies change). At any rate I don't generally post about InterJinn here anymore since some of the regulars tend to get annoyed ;) Mind you I don't post much at all anymore since I became a father a year and a half ago... priorities you know :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ive been using smarty (http://smarty.php.net) Just FYI, you've opened the door for a holy war, as temlating and template engines are a fairly volatile topic, with many people holding very extreme opinions on the subject. (me? I use Smarty.) So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? I don't use smarty... I do it all with vi macros!!! vi rocks! *wink* :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. To state the obvious... the above is in actuality a flame disguised as an excuse. Hey Rob, I sorry for the mix up but the above (however obvious) was *not* meant to be a flame, I was *only* joking with the guy. Is it just me or is joking becoming outlawed on the list? Most of us are geeks or classified as geeks on the lista little geek humour please? programming is a serious business and i find myself getting quite stressed sometimesusing a little humour or reading others humourous replies helps IMHO. Cheers, -Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
/* Mind you I don't post much at all anymore since I became a father a year and a half ago... priorities you know :) */ Almost forgot, congrats on your kid. Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Is it just me or is joking becoming outlawed on the list? Most of us are geeks or classified as geeks on the lista little geek humour please? programming is a serious business and i find myself getting quite stressed sometimesusing a little humour or reading others humourous replies helps IMHO. Humor is on my TODO list. Clearly the creators of PHP have a sense of humor... I mean who puts a picture of a bunny that shows up as an easter egg on (what else) Easter? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On 4/28/2005 8:05:31 PM, John Nichel ([EMAIL PROTECTED]) wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. hehe used to be on mine too, then I finally made a TODO list and now I have a TODO reminder to do the things on my TODO list. :-p Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Templating engines
[snip] Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. [/snip] Now, I know that we all love to discuss small dogs from Kansas, but I've too much to do right now. TYVM! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Thursday 28 April 2005 02:05 pm, John Nichel wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] Just out of curiosity, are there any templating engines out there that would automatically generate and then fill in values for a TODO list? IATOL, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Andre Dubuc wrote: On Thursday 28 April 2005 02:05 pm, John Nichel wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] Just out of curiosity, are there any templating engines out there that would automatically generate and then fill in values for a TODO list? IATOL, Andre Not yet, but it is non my TODO list grt, Ever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ryan A wrote: I would go for a xml-style template engine (start flaming right below this thread) Hey Rob, I sorry for the mix up but the above (however obvious) was *not* meant to be a flame, I was *only* joking with the guy. Is it just me or is joking becoming outlawed on the list? Most of us are geeks or classified as geeks on the lista little geek humour please? programming is a serious business and i find myself getting quite stressed sometimesusing a little humour or reading others humourous replies helps IMHO. Cheers, -Ryan Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On 4/28/2005 8:18:28 PM, Andre Dubuc ([EMAIL PROTECTED]) wrote: On Thursday 28 April 2005 02:05 pm, John Nichel wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] Just out of curiosity, are there any templating engines out there that would automatically generate and then fill in values for a TODO list? Nope, but I am planning to make oneits on my TODO list. IATOL, Whats IATOL? Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
/* I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. */ Sounds like you are pretty good with xml... i know very little of XML, do you have a link I can read up on to learn the language? My knowledge of the subject is pretty shameful :-( Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Templating engines
[snip] Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. [/snip] Now, I know that we all love to discuss small dogs from Kansas, but I've too much to do right now. TYVM! Hey Jay, Just wanted to tell youone of your snip tags are open :-D Cheers, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Thursday 28 April 2005 03:21 pm, Ryan A wrote: On 4/28/2005 8:18:28 PM, Andre Dubuc ([EMAIL PROTECTED]) wrote: On Thursday 28 April 2005 02:05 pm, John Nichel wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] Just out of curiosity, are there any templating engines out there that would automatically generate and then fill in values for a TODO list? Nope, but I am planning to make oneits on my TODO list. IATOL, Whats IATOL? Cheers, Ryan Aha! A bite! 'IATOL' = 'Ignorance At The Outer Limits' (derivative of my usual tagline: Ignorance is a way of life) Hth, : Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Templating engines
[snip] [snip] Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. [/snip] Now, I know that we all love to discuss small dogs from Kansas, but I've too much to do right now. TYVM! Hey Jay, Just wanted to tell youone of your snip tags are open :-D [/snip] Note the coding style of the open snip tag, I believe that would be Jason's Gestooberhanken! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
/* I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. */ Sounds like you are pretty good with xml... i know very little of XML, do you have a link I can read up on to learn the language? My knowledge of the subject is pretty shameful :-( http://www.w3schools.com/default.asp links on the left are a decent start... -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Templating engines
[snip] and box of bending straws. [/snip] Nice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jay Blanchard wrote: snip Note the coding style of the open snip tag, I believe that would be Jason's Gestooberhanken! /snip Btt. Awww, sorry, but you do not win the grand prize. However, we do have some nice parting gifts for you. Tell him what he's won Chuck. Well John, for Jay we have a year's supply of post-processed fecal matter, and box of bending straws. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
On Thu, 2005-04-28 at 13:53, Ryan A wrote: I would go for a xml-style template engine (start flaming right below this thread) Flaming??? who has time to start flaming after reading what you wrote? am busying banging my head against the wall. To state the obvious... the above is in actuality a flame disguised as an excuse. Hey Rob, I sorry for the mix up but the above (however obvious) was *not* meant to be a flame, I was *only* joking with the guy. Sorry, I meant to put a smiley at the end of the my comment :) I knew you were just joking *heheh*. Cheers, Rob. Is it just me or is joking becoming outlawed on the list? Most of us are geeks or classified as geeks on the lista little geek humour please? programming is a serious business and i find myself getting quite stressed sometimesusing a little humour or reading others humourous replies helps IMHO. Cheers, -Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 4/27/2005 -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Templating engines
Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. Switching HTML to XHTML output is very trivial. xsl:output mode=xml ... / to xsl:output mode=html ... / Ensures proper escaping, which helps to eliminate XSS problems. Can use indenting to produce easier to read HTML (for debugging purposes) and then switch it off to save space/bandwidth in production. xsl:ouput indent=yes ... / and xsl:output indent=no ... / Xpath string functions provide support for multiple character sets/encodings. [I haven't used Smarty, but I'm aware a IntSmarty had to be created to cater for things like this.] Mozilla IE both can perform client side transforms, using ?xml-stylesheet ? processing instruction. Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Hi Ryan, The XML basics are really simple and can be learned in 15 minutes, so I suppose you already know this. I personally think www.xml.com has some good resources, and they don't just keep it with theory and translate the stuff to practical situations. Also google for stuff like namespaces (along with DTD's) and XSL/XSLT. I guess I learned most of it by keeping track of W3C mailinglist and after that just googling to people who had some subjects about it. I personally fully support the Semantic web idea, the rise of RSS proofs that (it's sad there are so many standards instead of just the W3c RDF/RSS standard). In ways of communicating between webservices it's the future (either that or microsofts vision, I fear the longhorn). grt, Evert Ryan A wrote: /* I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. */ Sounds like you are pretty good with xml... i know very little of XML, do you have a link I can read up on to learn the language? My knowledge of the subject is pretty shameful :-( Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jason Barnett wrote: Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. The geek factor is very important for my projects first of all =) The second also applies (output for multiple purposes). You really hit the nail here, because I am also using it with XUL, XForms and some other markups. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jason Barnett wrote: Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. The geek factor is very important for my projects first of all =) The second also applies (output for multiple purposes). You really hit the nail here, because I am also using it with XUL, XForms and some other markups. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php