Check compatability of reset, current, end, prev, and next in v5
Smarty v4 has special handling for reset, current, end, prev, and next in certain contexts. Check if behavior is consistent in v5.
I want to upgrade from Smarty v4.5.3 => to v5.* in my PHP Framework https://emvicy.com/ on branch 2.x (https://github.com/emvicy/Emvicy/tree/2.x) and Smarty in v5.4.0 gives me this kind of error.
example
<code>
/* array $aToolbar.aPathParam */
{if true === empty($aToolbar.aPathParam)}
...true....
{else}
...false...
{/if}
</code>
error
Syntax error in template "string: [..] on line 287
"{if true === empty($aToolbar.aPathParam)}" unknown modifier 'empty'
I could not find any help on this specific topic yet (looked after also in https://smarty-php.github.io/smarty/stable/upgrading/#removed-smarty-api-methods)
So - How to handle or rewrite those kind of template code to get it work in Smarty 5 ?
Please see https://smarty-php.github.io/smarty/stable/upgrading/#using-native-php-functions-or-userland-functions-in-your-templates
Thank you for your answer, but unfortunately it doesn't really help me. I had already read that native php functions are no longer supported and that plugins should be registered instead (and I'm not happy about that).
I am very familiar with the use of plugins etc. in Smarty. The question I am asking is a bit different.
I do need such expressions as shown below in templates. How can or must this logical expression be noted in a Smarty template in the future:
formerly
{if true === empty($aVar)} ... {/if}
future ?
{if true === ($aVar|emptyModifier)} ... {/if}
I had not found anything about this. Sorry for my perhaps unclear previous formulation.
You shouldn't have to change your templates at all.