I've looked at several web software, they have stuff like that {$title} or {$user}?

What do I need to use this one. Tpl file, and what is this in general?

4 Years
Discussion Span
Last Post by cmps

This may be a template file, where the php variables mentioned are parsed.
The tpl files theselves do not hold any php code, just placeholders for those variables. The main php pages include those tpl template files and say something like - OK wherever you see {$title} replace it with the value I have for the $sometitlevariable variable. This is usually done via an object, for example:

$page->assign("title", $mytitlevariable);

That means fidn the {$title} variable in the page text (hence "title") and replace it with whatever's help in the $mytitlevariable variable.
Depending on the templating engine used the syntax will vary. Common templating engines include Smarty, Twig, RainTPL and about a million others :)

Edited by diafol



Ok, so I can use that object using include "var.php"; ?
Is it somewere I can read about this?

What is the best way to learn php?


Dear bassznapper, you can learn this kind of coding by reading the documentation in Smarty or any other php template sys. Personally I don't like this kind of (not real programming).
If you learn a php template system you will not be able to learn or understand any programming language.
To learn PHP, you can buy PHP for dummies or google some tutorials, and of course we will help you in every step by feeling free to ask questions here on the forum :))

Good Luck ...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.