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

@@ -59,4 +59,17 @@ func main() {
### PHP
TODO
```php
use TheCodingMachine\Gotenberg\Client;
use TheCodingMachine\Gotenberg\DocumentFactory;
use TheCodingMachine\Gotenberg\MarkdownRequest;
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
$index = DocumentFactory::makeFromPath('index.html', 'index.html');
$markdowns = [
DocumentFactory::makeFromPath('file.md', 'file.md'),
];
$request = new MarkdownRequest($index, $markdowns);
$dirPath = "/foo";
$filename = $client->store($request, $dirPath);
```