Jump to content

Is it PHP : {if $related_categories}


ze_newbie

Recommended Posts

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.