Validation post data the controller

I write rest api.

How validate post data into controller?

...
$data = $this->request->getJsonRawBody();
...

What do next?



29.1k
edited Jun '14

first see how how $data looks like: var_dump($data)

then write your validation routines or use phalcon's validation facilities...