What are the {} tags in the middle of the html

0

On a webpage with .html extension, you can not use the php tags right?

But I saw in some pages html codes of type {CONTEUDO} which displays a text defined in a file php '$tpl->CONTEUDO = "texto" '. But I do not exactly understand the use of these { } tags to show something of php , can you show a variable or a constant in this way?

Code php:

    require("banco.php");
require("classes/funcoes.php");
require("classes/String.php");
require("classes/Template.class.php");

$tpl = new Template("html/template.html");

//-- Google ****
$tpl->PG_TITLE = "Rações Catarinense";
$tpl->PG_DESCRIPTION = "Rações Catarinense ";
$tpl->PG_KEYWORDS = "Rações Catarinense ";
$tpl->PG_CANONICAL = "http://www." . $_SERVER['SERVER_NAME'] . "/";
//-- Google ****
// Adicionando mais um arquivo HTML
$tpl->addFile("CONTEUDO", "html/produto.html");

$tpl->CSS = "produto";
$tpl->ATIVO_home = 'class="ativo"';

$tpl->PAGINA_ATIVA = "produto-body";

On the product.html page these attributes are displayed as '{PAGINA_ATIVA}'

    
asked by anonymous 09.03.2016 / 15:05

2 answers

1

In fact, php can also be written with .tpl files.

The tpl is more for a Smarty File, where it serves as a transitor of commands, and they (PHP commands) can be called in tpl.html through {php} comandos {/php} for example

To make the call at the beginning of the Header, you use {include file='arquivoX.tpl' p="index"}

Actually you can not call PHP commands directly in .html because it would not go through the interpreter that generates the page, so to work it should be used or .php files <?php ?> or .tpl {php} {/php}

Can you show us this code page to try to understand better?

    
09.03.2016 / 15:22
1

This is a template. Probably another page is doing include with this page < a href="/ questions / tagged / html" class="post-tag" title="show questions tagged 'html'"> html and doing replace in content that has keys by the value of the variable .

    
09.03.2016 / 15:22