Browse Source

Use single quotes in PHP example template and mention how to customise them

Robbie Averill 5 năm trước cách đây
mục cha
commit
7306f69013

+ 2 - 0
docs/generating-documentation.md

@@ -58,6 +58,8 @@ php artisan apidoc:rebuild
 
 - Generate your documentation 
 
+To customise existing language templates you can perform the `vendor:publish` command above, then modify the blade templates in `resources/` as necessary.
+
 ## Further modification
 
 This package uses [Documentarian](https://github.com/mpociot/documentarian) to generate the API documentation. If you want to modify the CSS files of your documentation, or simply want to learn more about what is possible, take a look at the [Documentarian guide](http://marcelpociot.de/documentarian/installation).

+ 2 - 2
resources/views/partials/example-requests/php.blade.php

@@ -2,7 +2,7 @@
 
 $client = new \GuzzleHttp\Client();
 $response = $client->{{ strtolower($route['methods'][0]) }}(
-  "{{ rtrim($baseUrl, '/') . '/' . ltrim($route['boundUri'], '/') }}",
+  '{{ rtrim($baseUrl, '/') . '/' . ltrim($route['boundUri'], '/') }}',
   [
 @if(!empty($route['headers']))
     'headers' => {!! \Mpociot\ApiDoc\Tools\Utils::printPhpValue($route['headers'], 4) !!},
@@ -10,7 +10,7 @@ $response = $client->{{ strtolower($route['methods'][0]) }}(
 @if(!empty($route['cleanQueryParameters']))
     'query' => [
 @foreach($route['cleanQueryParameters'] as $parameter => $value)
-      "{{$parameter}}" => "{{$value}}",
+      '{{$parameter}}' => '{{$value}}',
 @endforeach
     ],
 @endif