Search code examples
phprestler

How to log the POST request data before the validation?


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


Solution

  • 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());
    }