Hey,

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?

Recommended Answers

All 4 Replies

Member Avatar for diafol

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 :)

Tnx.

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?

Smells like Smarty to me (PHP templating system).

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 ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.