Reputation: 65
This does not display:
include {php} echo "hello" {/php}
Smarty.class.php
and smarty_security.php
I have $allow_php_tag = true;
but {php} echo "hello" {/php}
not work. No display "hello" on my side.
Why not?
Upvotes: 1
Views: 920
Reputation: 111889
Using PHP in Smarty templates is not recommended and has been deprecated in Smarty 3.1
However if you really need to use PHP in Smarty template you need to use SmartyBC
class and not Smarty
class. To do that:
Go to config/smarty.config.inc.php
Change
require_once(_PS_SMARTY_DIR_.'Smarty.class.php');
into
require_once(_PS_SMARTY_DIR_.'SmartyBC.class.php');
$smarty = new Smarty();
into
$smarty = new SmartyBC();
That's it. You don't need to do anything more (tested in Prestashop 1.6.0.8)
Upvotes: 2