Domanda

Is there a way to log the received POST request data before the data validation stage implemented via Restler?

È stato utile?

Soluzione

Use the onValidate event, it fires just before validation starts

//in your index.php after $r = new Restler()

$r->onValidate(function() use ($r){
    Logger::log($r->getRequestData());
}

Altri suggerimenti

Copy them to a variable, and validate values inside the variable:'

$my_post = $_POST;

//consider we want to validate some query-parameter called q

if(isset($my_post['q']) && ! empty($my_post['p'])) {
    //do something
} 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top