Validation\Validator\PresenceOf

Class Phalcon\Validation\Validator\PresenceOf

extends abstract class Phalcon\Validation\Validator

implements Phalcon\Validation\ValidatorInterface

Source on GitHub

Validates that a value is not null or empty string

use Phalcon\Validation\Validator\PresenceOf;

$validator->add(
    "name",
    new PresenceOf(
        [
            "message" => "The name is required",
        ]
    )
);

$validator->add(
    [
        "name",
        "email",