Jump to content


Photo

Is it PHP : {if $related_categories}


  • Please log in to reply
9 replies to this topic

#1 ze_newbie

ze_newbie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 August 2006 - 03:32 PM

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.

{$header}
{$lang.categories}
{/if}
{if $related_categories}

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 :

<meta name="keywords" content="{$keywords}" /> 
<br />

My 2nd question is : why is it for example
<br /> and not <br>
?

Thanks in advance.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 August 2006 - 03:37 PM

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.

#3 ze_newbie

ze_newbie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 August 2006 - 03:39 PM

Thanks thorpe for your quick reply.
Please is there any tutorial for this.

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 August 2006 - 03:42 PM

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 not be a good place for a newbie to start learning php.

#5 ze_newbie

ze_newbie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 August 2006 - 03:52 PM

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

#6 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 24 August 2006 - 04:21 PM

still, you should start by learning the traditional hello world, rather than an entire script, where basic syntax and rule knowledge are assumed.

<?php
  echo "hello world";
?>

for instance.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#7 ze_newbie

ze_newbie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 August 2006 - 04:34 PM

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
<?php
  echo "hello world";
?>
I already know that.
Excuse for disturbing.


#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 24 August 2006 - 04:35 PM

Google racked up quite a few results on the subject, Ive not read any tutorials myself.

#9 ze_newbie

ze_newbie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 August 2006 - 04:39 PM

Many thanks thorpe for your help.
Want also to say that I like phpfreaks.com.

#10 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 24 August 2006 - 04:40 PM

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
<br/>
and not
<br>
(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?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users