User Tools

Site Tools


Sidebar

designers:no_use_php

Alternatives for {php} In Templates

Use of the {php} in Smarty templates is removed and should not be used, as going forward starting in Smarty 3.1 they will no longer work. Starting in version 6.0.0 which uses Smarty 3.1.5, you will no longer be able to use {php} Smarty tags and must use an alternate resource instead. More info can be read in the Smarty 3.1 Release Notes. Here is a snippet from that specifically affecting the {php} (and related) functions:

There is absolutely no PHP allowed in templates any more. All
deprecated features of Smarty 2.0 are gone. Again, use the SmartyBC
class if you need any backward compatibility.

You can also read more info about it on the smarty.net documentation page for {php}. Below are alternatives to using {php} in your templates specific for this software.

  • Use an Addon Tag instead, or use one of the other tools available to addons in the software. As of Version 6.0.0, all addon tags are called on the fly, with the $params and $smarty vars passed to the tag methods. For addon developers, this means you now have same abilities as you would if you created a custom smarty plugin! See the smarty.net documentation for Plugin Functions for more info.
  • Create a custom smarty plugin. See the smarty.net documentation for more info.
designers/no_use_php.txt · Last modified: 2014/09/25 16:55 (external edit)