Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Symfony version | all |
In my project I get assert constraints from one of my entity and I use this value in my front end via Twig.
I faced a problem with the property $maxSize of the File Constraint.
As this property is protected I cannot access it via Twig because the magic method __isset
is missing, as I read in twig documentation.
so I propose to add this piece of code to be able to get this value accessible in Twig:
public function __isset($option)
{
if ('maxSize' === $option) {
return true;
}
return parent::__isset($option);
}
this solution work for sure as I tested it, but my question is why this is not a simple public property as the rest of the File Constraint class properties?