User Tools

Site Tools


Sidebar

designers:no_use_php

This is an old revision of the document!


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 read more info about it on the smarty.net documentation page for {php}. Technically speaking, it is possible to use a "Backwards Compatibility" layer to allow using {php} but doing so will require making changes to core PHP files, which is not supported or recommended. 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.
  • Create a smarty plugin.
designers/no_use_php.1321316480.txt.gz · Last modified: 2014/09/25 16:55 (external edit)