You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
did you use some for of custom compile stap to define shorttag attributes? The example you give creates an error for any number of shorthand attributes:
<?php
require_once './vendor/autoload.php';
$smarty = new Smarty();
$smarty->registerPlugin("function","funcName", function ($params, $smarty) { return ''; });
$smarty->display('string:{funcName argumentValue argumentValue2}');
returns
PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "string:{funcName argumentValue argumentValue2}" on line 1 "{funcName argumentValue argumentValue2}" too many shorthand attributes <--
thrown in /home/workspace/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 1
Alright, i've renamed your PR to indicate this is not a bug but an enhancement, and referenced it in #165 where @cdp1337 suggested the same change. I'll close this issue now.
Current state
Good examples
When custom template function is called with named argument:
in function body arg can be accessed:
When more named arguments are passed:
in function body args can be accessed:
When more shorthand args are passed:
in function body args can be accessed:
Unexpected behavior (BUG)
But when one shorthand arg is passed:
The "too many shorthand attributes" error is triggerd.
Expected behavior
When one shorthand arg is passed (it should be the same as when more shorthand args are passed):
in function body arg can be accessed:
The text was updated successfully, but these errors were encountered: