New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some php function have error with registerPlugin #961
Comments
I don't think there's an easy fix for this. Can you change your template to use a foreach loop? |
No, I don't need foreach. |
What is advantage of using version 5 when all default functions of PHP are removed and must be added manually and there are problems with some functions. |
Smarty 5 adds support for ternary operator and the null coalescing operator, positional parameters for custom tags and a whole new extension architecture. |
Well, they are useful if smarty has no problem with default PHP functions. In version 4, many people may have used many PHP functions in smarty that do not have their list. Finding these functions and also having problems in calling them is a very difficult issue. |
I have listed some of functions:
|
@Nightprince for a discussion about the decision to drop support for the use of unregistered callables in v5, see #967. For the breaking change regarding passing variables by reference, I'll use #964 and close this issue. |
Why should issue be closed when problem is not fixed? |
So we don't have 2 open issues for the same problem. |
Re-opening this, since it seems #964 is fixed (for Smarty > v4), but we cannot port that fix to Smarty v5. |
I suggest you add these as default in Smarty. |
reset(), key(), end() , ... have error when we use registerPlugin, error :
Error: ErrorException: reset(): Argument #1 ($array) must be passed by reference, value given in F:\laragon\www\CMS\vendor\smarty\smarty\src\Extension\CallbackWrapper.php:29
$this->registerPlugin(Smarty::PLUGIN_MODIFIER, 'end', 'end');
$this->registerPlugin(Smarty::PLUGIN_MODIFIER, 'key', 'key');
$this->registerPlugin(Smarty::PLUGIN_MODIFIER, 'reset', 'reset');
...
The text was updated successfully, but these errors were encountered: