So in v5.0.0-rc3 I could register a Plugin-Function and do something like this:
{myFunc test1 arg='arg'}
because of this fix: #953 it's not possible anymore to assign string attributes, because of this section in Compiler/Base.php:
if (!is_array($mixed)) {
// options flag ?
if (isset($options[trim($mixed, '\'"')])) {
$_indexed_attr[trim($mixed, '\'"')] = true;
// shorthand attribute ?
} elseif (isset($this->shorttag_order[$key])) {
$_indexed_attr[$this->shorttag_order[$key]] = $mixed;
} else {
// too many shorthands
$compiler->trigger_template_error('too many shorthand attributes', null, true);
}
// named attribute
}
Because shorttag_order wasn't empty it would just insert Attribute test1 into $_indexed_attr and I could use it as ['var1'].
I found it quite useful cause the first argument could be used as some kind of identifier.
I found old issues that discuss this shorthand syntax for example: #165, #342, #568
So is this Syntax officially dead in Smarty v5.0.0? Or is there a way to kind of inject the first parameter still as a string?
Thank you!
So in
v5.0.0-rc3I could register a Plugin-Function and do something like this:{myFunc test1 arg='arg'}because of this fix: #953 it's not possible anymore to assign string attributes, because of this section in Compiler/Base.php:
Because shorttag_order wasn't empty it would just insert Attribute
test1into$_indexed_attrand I could use it as ['var1'].I found it quite useful cause the first argument could be used as some kind of identifier.
I found old issues that discuss this shorthand syntax for example: #165, #342, #568
So is this Syntax officially dead in Smarty v5.0.0? Or is there a way to kind of inject the first parameter still as a string?
Thank you!