(09-23-2021, 04:13 AM)iRedds Wrote: When you call $this->validate($rules), the method will automatically try to determine the content type and retrieve data for validation.
When you call $this->validation->run($_POST), you yourself define the data to validate.
That's what I figured out, though it took me some time
.
As for $_POST, I was trying different things, it was late, I assigned request to this super global. I guess I will change it later to something like $jsonData so it doesn't say $_POST.
This should result in the following.
PHP Code:
$this->validation->run($jsonData);