0
votes

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.

3

3 Answers

0
votes

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

0
votes

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

0
votes

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