jak w taki szablon wstawić kod php, który np wykona echo'd';:
Kod
<html>
<head>
<title>Smarty: pierwszy skrypt</title>
</head>
<body>
<p>Hello world! TPL {$data}!</p>
</body>
</html>
<head>
<title>Smarty: pierwszy skrypt</title>
</head>
<body>
<p>Hello world! TPL {$data}!</p>
</body>
</html>
Dodam, że nie działa:
Kod
{php} echo 'd'; {/php}
oraz
Kod
<{php}> echo 'd'; <{/php}>
A błąd, który otrzymuję:
Kod
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "..\web\templates\index.tpl" on line 7 "{php}{/php}" unknown tag "php"' in F:\WORK\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665
( ! ) SmartyCompilerException: Syntax Error in template "..\web\templates\index.tpl" on line 7 "{php}{/php}" unknown tag "php" in F:\WORK\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665
( ! ) SmartyCompilerException: Syntax Error in template "..\web\templates\index.tpl" on line 7 "{php}{/php}" unknown tag "php" in F:\WORK\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665