php-slim-server.api.mustache Maven / Gradle / Ivy
getHeaders();
{{#headerParams}}
${{paramName}} = $request->hasHeader('{{baseName}}') ? $headers['{{baseName}}'] : null;
{{/headerParams}}
{{/hasHeaderParams}}
{{#hasPathParams}}
{{#pathParams}}
${{paramName}} = $args['{{baseName}}'];
{{/pathParams}}
{{/hasPathParams}}
{{#hasQueryParams}}
$queryParams = $request->getQueryParams();
{{#queryParams}}
${{paramName}} = $request->getQueryParam('{{baseName}}');
{{/queryParams}}
{{/hasQueryParams}}
{{#hasFormParams}}
{{#formParams}}
{{^isFile}}
${{paramName}} = $request->getParsedBodyParam('{{baseName}}');
{{/isFile}}
{{#isFile}}
${{paramName}} = (key_exists('{{baseName}}', $request->getUploadedFiles())) ? $request->getUploadedFiles()['{{baseName}}'] : null;
{{/isFile}}
{{/formParams}}
{{/hasFormParams}}
{{#hasBodyParam}}
$body = $request->getParsedBody();
{{/hasBodyParam}}
$response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?');
return $response;
}
{{/operation}}
{{/operations}}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy