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
PHP 8.2 and greater disables creating dynamic properties on a class. If you want to use ApplicationLatte\Template instead of ApplicationLatte\DefaultTemplate - calling render() or renderToString() method with some parameter will fail, because dynamic property is creating and only DefaultTemplate has AllowDynamicProperties attribute, that allows this.
Steps To Reproduce
$template = newNette\Bridges\ApplicationLatte\Template(newLatte\Engine());
$template->render('test.latte', ['name' => 'test']);
// Deprecated: Creation of dynamic property [Nette\Bridges\ApplicationLatte\Template]::$name is deprecated
Expected Behavior
Template is correctly rendered.
Possible Solution
Add #[\AllowDynamicProperties] also to ApplicationLatte\Template class? Don't use dynamic properties and use __get/__set/__isset/__unset instead of it?
The text was updated successfully, but these errors were encountered:
Version: 3.0
Bug Description
PHP 8.2 and greater disables creating dynamic properties on a class. If you want to use
ApplicationLatte\Template
instead ofApplicationLatte\DefaultTemplate
- callingrender()
orrenderToString()
method with some parameter will fail, because dynamic property is creating and onlyDefaultTemplate
hasAllowDynamicProperties
attribute, that allows this.Steps To Reproduce
Expected Behavior
Template is correctly rendered.
Possible Solution
Add
#[\AllowDynamicProperties]
also toApplicationLatte\Template
class? Don't use dynamic properties and use__get/__set/__isset/__unset
instead of it?The text was updated successfully, but these errors were encountered: