Reputation: 1061
I am unable to write PHP code in .tpl file in either ways
I tried <?php echo 'test'; ?>
I also tried {PHP} echo 'test'; {/PHP}
But both returned error
on line 14 "{php}echo "hello!"{/php}" unknown tag "php"
Upvotes: 0
Views: 1373
Reputation: 458
I've not worked with Kohana, but with Smarty 3, use of the php tag is deprecated. You'll need to use the backwards compatibility mode with 3.0. It is highly recommended that all code logic be placed in your controller or php script files, and not your Smarty templates.
If you want to use PHP code in templates, it is suggested you create custom functions or modifiers.
So, basically, the short answer is find where your code (or the Kohana plugin) is instantiating Smarty and change it to use SmartyBC, but be aware that this is highly discouraged.
If you are using Kohana Smarty3 module for Kohana, these code lines should help set you in the right direction.
Upvotes: 2