We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version: 3.1
Variables are passed invalid to block
The issue you can reproduce on: https://fiddle.nette.org/nette/#87a55c3e23
$name = hack instead error, or $value = hack (as hack is 2nd passed variable to block)
Instead of rendering block with parameters in array => maybe could be used variadic arguments?
Ie, instead: $this->renderBlock('BLOCK', [$name, 0 => 'hack'] + [], 'html') /* line 1 */; $name = $ʟ_args[0] ?? $ʟ_args['name'] ?? null; $value = $ʟ_args[1] ?? $ʟ_args['value'] ?? null;
use: $this->renderBlock('BLOCK', $this->parameters($name, 01, 02), 'html') /* line 1 */; $name = $ʟ_args[0] ?? null; $value = $ʟ_args[1] ?? null;
public function parameters(...$allParams){ return $allParams; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version: 3.1
Bug Description
Variables are passed invalid to block
Steps To Reproduce
The issue you can reproduce on: https://fiddle.nette.org/nette/#87a55c3e23
Expected Behavior
$name = hack instead error, or $value = hack (as hack is 2nd passed variable to block)
Possible Solution
Instead of rendering block with parameters in array => maybe could be used variadic arguments?
Ie, instead:
$name = $ ʟ_args[0] ?? $ʟ_args['name'] ?? null;
$value = $ ʟ_args[1] ?? $ʟ_args['value'] ?? null;
$this->renderBlock('BLOCK', [$name, 0 => 'hack'] + [], 'html') /* line 1 */;
use:
$name = $ ʟ_args[0] ?? null;
$value = $ ʟ_args[1] ?? null;
$this->renderBlock('BLOCK', $this->parameters($name, 01, 02), 'html') /* line 1 */;
public function parameters(...$allParams){
return $allParams;
}
The text was updated successfully, but these errors were encountered: