PHP Class Phalcon\Validation\Validator\CardNumber

Checks if a credit card number using Luhn algorithm use Phalcon\Validation\Validator\CardNumber as CreditCardValidator; $validator->add('creditcard', new CreditCardValidator([ 'message' => 'The credit card number is not valid', 'type' => CardNumber::VISA, // Any if not specified ]));
Inheritance: extends Phalcon\Validation\Validator
Exibir arquivo Open project: phalcon/incubator

Public Methods

Method Description
validate ( Phalcon\Validation $validation, string $attribute ) : boolean

Method Details

validate() public method

public validate ( Phalcon\Validation $validation, string $attribute ) : boolean
$validation Phalcon\Validation
$attribute string
return boolean