0

I want to write PHP code for a Smarty .tpl file. But it is giving me the following error:

Uncaught --> Smarty Compiler: Syntax error in template "./templates/register.tpl" on line 185 "{php}" unknown tag "php" <-- thrown in /opt/lampp/htdocs/Smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 185

When I Google it, I realized it's deprecated and not recommended to use. What should I do now? I want to show drop down with the security question in it.

Gokhan Kurt
  • 8,239
  • 1
  • 27
  • 51
Dimple
  • 45
  • 8

3 Answers3

0

Not sure what Smary is or how it is used, but what I get from documentation is that {php} is deprecated.

http://www.smarty.net/docs/en/language.function.php.tpl

Siim Kallari
  • 851
  • 6
  • 17
0

to echo the $foo variable in tpl file just past {$foo}

Maninderpreet Singh
  • 2,569
  • 2
  • 17
  • 31
0

You should make changes in smarty_securoty.php and make

public $allow_php_tag = false; to

public $allow_php_tag = true;

it allow PHP Code in .tpl file