Add missing formParams to PHP api.mustache. Fixes #383.

Also fixed mixed tabs and spaces in template.
This commit is contained in:
Samuel Reed 2015-01-21 10:01:41 +01:00
parent 3abc42eee9
commit 7c342a060a

View File

@ -67,10 +67,20 @@ class {{classname}} {
} }
{{/pathParams}} {{/pathParams}}
//make the API Call // Generate form params
if (! isset($body)) { if (! isset($body)) {
$body = array();
}
{{#formParams}}
if(${{paramName}} != null) {
$body['{{paramName}}'] = ${{paramName}};
}
{{/formParams}}
if (empty($body)) {
$body = null; $body = null;
} }
// Make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method, $response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $body, $queryParams, $body,
$headerParams); $headerParams);