adding PHP examples in documentation

This commit is contained in:
Julien Neuhart
2018-12-10 19:12:54 +01:00
parent 7aeb072cc3
commit 9ce179f91b
7 changed files with 215 additions and 17 deletions

View File

@@ -42,4 +42,14 @@ func main() {
### PHP
TODO
```php
use TheCodingMachine\Gotenberg\Client;
use TheCodingMachine\Gotenberg\DocumentFactory;
use TheCodingMachine\Gotenberg\HTMLRequest;
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
$index = DocumentFactory::makeFromPath('index.html', 'index.html');
$request = new HTMLRequest($index);
$request->setWebhookURL('http://myapp.com/webhook/');
$resp = $client->post($request);
```