ze_newbie Posted August 24, 2006 Share Posted August 24, 2006 Hello everybody,It's my first post and I just started learning PHP.So excuse me for these newbie questions.I open a template (with .tpl extension) and I found these snippets.[code]{$header}{$lang.categories}{/if}{if $related_categories}[/code]My 1st question is : I think it is not PHP, please can you tell me what does it mean ?In the template I found also this :[code]<meta name="keywords" content="{$keywords}" /> <br />[/code]My 2nd question is : why is it for example [code]<br /> and not <br>[/code] ?Thanks in advance. Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2006 Share Posted August 24, 2006 You are correct, this is not php. There are many template systems built with php and this appears to be one of them. Usually these template files are parsed by a template engine and the {$variables} you see are replace by something in a database. Quote Link to comment Share on other sites More sharing options...
ze_newbie Posted August 24, 2006 Author Share Posted August 24, 2006 Thanks thorpe for your quick reply.Please is there any tutorial for this. Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2006 Share Posted August 24, 2006 There are literally thousands of template engines written in php. Most are pretty simular though some are more complex. What is it you want a tutorial on? Creating the .tpl files? Or actually building a template engine?The later would [b]not[/b] be a good place for a newbie to start learning php. Quote Link to comment Share on other sites More sharing options...
ze_newbie Posted August 24, 2006 Author Share Posted August 24, 2006 Both please.Don't worry I learn quickly and I had many years of assembly programming. Assembly was like my mother tongue.I stopped coding for years but the "mechanic" still nice. ;D Quote Link to comment Share on other sites More sharing options...
.josh Posted August 24, 2006 Share Posted August 24, 2006 still, you should start by learning the traditional hello world, rather than an entire script, where basic syntax and rule knowledge are assumed. [code=php:0]<?php echo "hello world";?>[/code]for instance. Quote Link to comment Share on other sites More sharing options...
ze_newbie Posted August 24, 2006 Author Share Posted August 24, 2006 I already started with basics. I am not pretentious but for the "basics" I just need few days (quelques nuits blanches).If am able to write an emulator I think that a template engine will not fear me.Thanks for your help but a [code]<?php echo "hello world";?>[/code] I already know that.Excuse for disturbing. Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2006 Share Posted August 24, 2006 [url=http://www.google.com.au/search?q=php+template+engine+tutorial&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial]Google[/url] racked up quite a few results on the subject, Ive not read any tutorials myself. Quote Link to comment Share on other sites More sharing options...
ze_newbie Posted August 24, 2006 Author Share Posted August 24, 2006 Many thanks [b]thorpe[/b] for your help.Want also to say that I like phpfreaks.com. Quote Link to comment Share on other sites More sharing options...
.josh Posted August 24, 2006 Share Posted August 24, 2006 okay well good luck on learning to build a template engine then. maybe i misunderstood you. you seem to ask how to do it, but you ask basic syntax questions, like the {blah} and why something has [code]<br/>[/code] and not [code]<br>[/code] (which btw isn't even php it's plain old html). Maybe you can be more specific, or else maybe thorpe's linkie is what you are looking for? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.