everconfusedGuy
everconfusedGuy

Reputation: 2797

Accessing put variables using the SLIM framework

I am using the Slim framework to develop my rest API. I am having problems with the PUT request. I want to access variables sent from the client on the server side.

$app->put('post/:pid', function ($pid) {
    //how to access other data sent from the client?
}

Upvotes: 0

Views: 1757

Answers (1)

shernshiou
shernshiou

Reputation: 518

Refer the code below:

$app = \Slim\Slim::getInstance();
$request = $app->request();
$var = $request->put();

The variable is the form of array at $var

Upvotes: 3

Related Questions