-1

In magento 1 we could use Zend to validate input values, for example check if the value is an e-mail or an integer.

Example

if (!Zend_Validate::is($email, 'EmailAddress')) { ... }

How does it work in Magento 2?

1
  • Reason for downvote? – Black Oct 5 '20 at 12:24
1

In your Magento 2 Installation, take a look at the Validator located in /vendor/magento/framework/validator.

This is the README.md:

This library extends Zend Framework's validator library and is used for validating input data in forms. 
Implements an XML-configuration that allows defining validation constraints in a declarative way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.