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

Validate field not $_POST

I have the funtion:

public function validation()
{

    $validation = new Validation();
    $messages = $validation->validate($_POST);
    if(count($messages)){
        $this->validates($messages);
        return false;
    }
}

But i would like it to validate the fields that I try to insert only like:

$robot->name = 'Name'; $robot->lastname = 'Robot';

So that it validates the robot object and not $_POST array

Hi @GunslerRage it's very simple look the first example in model validation docs

Good luck