2

currently i change smarty 2 -> version 3

but after i change got problem as below.

SmartyCompilerException: Syntax Error in template 
"/home/test/engine/mobile9/template/t_footer.tpl" on line 28 
"{php}" unknown tag "php" in /home/test/engine/modules/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 617

after that i check smarty 3 documentations. it shown {php} is valid operator.

Paul DelRe
  • 4,003
  • 1
  • 24
  • 26
Leon
  • 413
  • 2
  • 9
  • 23

1 Answers1

4

Check the documentation here:

IMPORTANT NOTICE

{php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead. Note

As of Smarty 3.1 the {php} tags are only available from SmartyBC.

If you're using Smarty 3.0x, it should work. If you're using Smarty 3.1, you have to install the SmartyBC class (Backwards Compatibility Wrapper) for the use of the {php}-Tag.

But where possible try to follow Smartys advice: Put PHP logic in PHP scripts, and not into the Smarty templates.

Bjoern
  • 15,934
  • 4
  • 43
  • 48
  • thx a lot, coz this page will be remove soon, just temporary there. better include this pluggin. thx – Leon Nov 21 '11 at 07:20
  • == {php} Tag == The {php} tag is disabled by default. The use of {php} tags is deprecated. It can be enabled with $smarty->allow_php_tag=true. But if you scatter PHP code which belongs together into several {php} tags it may not work any longer. this is wat i found in smarty official sites. mayb this is one of the solutions. – Leon Nov 22 '11 at 03:17