We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to validate a field itself?

so, its ok to validate the form - but how to validate an induvidial item?

edited Dec '15

Not sure if it's what you're asking : after a form has been validated you can access field by field result :

if(!$form->isValid($data, $entity)) {
    $field = 'nameofthefield';
    if($form->hasMessagesFor($field)) {


I wanted to see a

$name = new Text("name");
    new PresenceOf(
            'message' => 'The name is required'
$name->whatMethodShouldITypeHereWhatSendsMeTrueOrFalseItTheInputIsValidOrNot() ?