New in Symfony 2.4: A more powerful image validator
When using a file upload input on an HTML page to allow images to be uploaded,
you should use the
Image constraint instead of the more generic
one. Besides restricting the allowed mime-types, it exposes additional options
specific to images like validating the image height or their width.
And as of Symfony 2.4, you can also validate the image aspect ratio (defined as
width / height) and selectively allow square, landscape, and portrait image
orientations with the new
Read the Image constraint documentation page for more information.
New in Symfony 2.4: A more powerful image validator symfony.com/index.php/blog/new-in-symfony-2-4-a-more-powerful-image-validatorTweet this
Become a certified developer! Exams are online and available in all countries.Register Now
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.