[PHP] Re: Website templating schemes
Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. Ronald Joel Konkle-Parker [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I'm trying to make a PHP-backed website, and I'm trying to decide between two templating schemes: 1. define 2 php template files: header.php, footer.php. in index.php, require header.php, output content, require footer.php 2. define a php template file and a local page file. index.php defines body() and crequires template.php. template.php prints the header, calls body() to print the content, and and prints the footer. I'm currently using the second method, but I've only seen the first used elsewhere. Is there a reason that #1 is better than #2 (or is anything else even better than that?)? -- Joel Konkle-Parker Webmaster [Ballsome.com] Phone [662-518-1636] E-mail[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Website templating schemes
Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. That'd be smarty.php.net ... didn't know .php was a tld :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Website templating schemes
Duncan Hill mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 8:07 AM said: Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. That'd be smarty.php.net ... didn't know .php was a tld :) And how about this one? www.microsoft.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Website templating schemes
rush wrote: While PHP is often considered as template system in it self, I think it is is not very strong, or efficient one. Wow... where'd you pull that from?? Any facts to back that up? :) FYI: I've got a template benchmark site running at http://sepodati.realxl.net/tpl_bench/ Any interest in looking over the code and adding a TemplateTamer benchmark to the list? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Website templating schemes
John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Wow... where'd you pull that from?? Any facts to back that up? :) :) no, I was think in terms of how easy is to write template oriented software, and how flexible te results are, which are all pretty subjective things, that is why I used I think fomulation :). Anyhow, it was not my intent to refer to the execution efficiency. My appologoizes for beeing misleading. FYI: I've got a template benchmark site running at http://sepodati.realxl.net/tpl_bench/ Any interest in looking over the code and adding a TemplateTamer benchmark to the list? I'll take a look, but I am not sure I could fit into the structure of the benchmark. Problem is that this benchmark oriented towards the simple templating class (or functions) that user has to initialize and make some calls in order to has his variables substituted. This benchmark then wraps this substitution calls in the loop to see how efficient is template engine at simple variable substitutions. TemplateTamer works other way around, it basically provides you a light framework, and code generator. You as a progaramer have a duty to provide the data for the variables (by returning them in the array as result of the getData() function), and there is no more you are doing. You do not initialize templates, you do not load various template files into the template engine, you do not assign variable one by one, you do not call substitute function, you do not echo the youtput in order for your page to appear. All this is handled by code that was generated by TemplateTamer or by framework. Actually first (internal) versions of TemplateTamer did not have its own template engine, they were just using FastTemplate for the task. I believe such approach can be a real time saver and more easy way to work, but it seems difficult to fit into your benchmark, but I will give it a try if nothing else to get one more link :) . Another problem is that thing that is benchmarked is plain page without structure. No subtemplates, not conditional parts, no repeated subtemplates. And I believe this is where the real action is for the templates, and this is all you have in the real world situations. Also I believe that in real world situations, time that is spent in the any template engine is not that important, usually the bottleneck is somewhere else, database most usually. But I am driffting. Thanks for the response! rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Website templating schemes
Joel Konkle-Parker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to make a PHP-backed website, and I'm trying to decide between two templating schemes: Neither sounds very exciting to me :) . While PHP is often considered as template system in it self, I think it is is not very strong, or efficient one. So if you would like to use templates you could consider some add-on to help you out. On the other hand if you do not like additional template systems for whatever reason, I am surrendering immediately to prevent holly war :) rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php