diff --git a/.idea/composerJson.xml b/.idea/composerJson.xml
deleted file mode 100644
index 1b074300..00000000
--- a/.idea/composerJson.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index c36e97d4..00000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/php.xml b/.idea/php.xml
deleted file mode 100644
index e1941cfa..00000000
--- a/.idea/php.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/sf4-test.iml b/.idea/sf4-test.iml
deleted file mode 100644
index 0e13db33..00000000
--- a/.idea/sf4-test.iml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/symfony2.xml b/.idea/symfony2.xml
deleted file mode 100644
index ba828bce..00000000
--- a/.idea/symfony2.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7f..00000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index d92a0626..00000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,861 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $PROJECT_DIR$/composer.json
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- db_user
- ManyToOne
-
-
- $PROJECT_DIR$/src/Entity
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
- true
- true
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1520949897852
-
-
- 1520949897852
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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/rest-bundle": "^2.3",
"sensio/framework-extra-bundle": "^5.1",
+ "sensio/generator-bundle": "^3.1",
"sensiolabs/security-checker": "^4.1",
"symfony/asset": "^3.4",
"symfony/console": "^3.4",
diff --git a/composer.lock b/composer.lock
index 512be1d8..6816cba8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "0f9764d69758baf439682a056b7455fe",
+ "content-hash": "67a565f8e92ab38b2b832b9520f2f951",
"packages": [
{
"name": "composer/ca-bundle",
@@ -1935,6 +1935,60 @@
],
"time": "2018-02-14T08:40:54+00:00"
},
+ {
+ "name": "sensio/generator-bundle",
+ "version": "v3.1.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git",
+ "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/28cbaa244bd0816fd8908b93f90380bcd7b67a65",
+ "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65",
+ "shasum": ""
+ },
+ "require": {
+ "symfony/console": "~2.7|~3.0",
+ "symfony/framework-bundle": "~2.7|~3.0",
+ "symfony/process": "~2.7|~3.0",
+ "symfony/yaml": "~2.7|~3.0",
+ "twig/twig": "^1.28.2|^2.0"
+ },
+ "require-dev": {
+ "doctrine/orm": "~2.4",
+ "symfony/doctrine-bridge": "~2.7|~3.0",
+ "symfony/filesystem": "~2.7|~3.0",
+ "symfony/phpunit-bridge": "^3.3"
+ },
+ "type": "symfony-bundle",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Sensio\\Bundle\\GeneratorBundle\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "This bundle generates code for you",
+ "time": "2017-12-07T15:36:41+00:00"
+ },
{
"name": "sensiolabs/security-checker",
"version": "v4.1.8",
diff --git a/config/bundles.php b/config/bundles.php
index 935def87..02492390 100644
--- a/config/bundles.php
+++ b/config/bundles.php
@@ -15,4 +15,5 @@ return [
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
+ Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle::class => ['all' => true],
];
diff --git a/src/Controller/ProductController.php b/src/Controller/ProductController.php
index bcd2e2eb..a590f018 100644
--- a/src/Controller/ProductController.php
+++ b/src/Controller/ProductController.php
@@ -13,6 +13,9 @@ use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
+use Endroid\Pdf\Pdf;
+use Endroid\Pdf\Response\InlinePdfResponse;
+
class ProductController extends FOSRestController {
/**
* @Route("/", name="product")
@@ -33,4 +36,5 @@ class ProductController extends FOSRestController {
return new Response( $allCategories );
}
+
}
diff --git a/src/Entity/Product.php b/src/Entity/Product.php
index b77d8bdc..e0c3fe79 100644
--- a/src/Entity/Product.php
+++ b/src/Entity/Product.php
@@ -88,6 +88,4 @@ class Product {
public function setCategory( ProductCategory $category ) {
$this->category = $category;
}
-
-
}
diff --git a/symfony.lock b/symfony.lock
index e0b12ac7..9d4e669e 100644
--- a/symfony.lock
+++ b/symfony.lock
@@ -137,6 +137,9 @@
"ref": "aaddfdf43cdecd4cf91f992052d76c2cadc04543"
}
},
+ "sensio/generator-bundle": {
+ "version": "v3.1.7"
+ },
"sensiolabs/security-checker": {
"version": "4.0",
"recipe": {
diff --git a/templates/pdf/content.html.twig b/templates/pdf/content.html.twig
new file mode 100644
index 00000000..87ca951c
--- /dev/null
+++ b/templates/pdf/content.html.twig
@@ -0,0 +1,19 @@
+
+
+ le contenu
+
Page 1
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci dicta dolores eligendi facilis in inventore
+ libero, maiores modi, natus nesciunt nostrum quae quas quasi sit unde vel veniam veritatis voluptas!
+
+
+
Page 2
+
etur adipisicing elit. Alias autem beatae dolorum impedit incidunt iusto necessitatibus, nulla perspiciatis
+ placeat repellat, suscipit vel! Aspernatur commodi consequuntur delectus dolore doloribus eaque exercitationem
+ incidunt inventore ipsum libero molestiae nesciunt non nostrum nulla, numquam porro, possimus quia quibusdam
+ ratione recusandae sed sunt totam veniam.
+
+
diff --git a/templates/pdf/footer.html.twig b/templates/pdf/footer.html.twig
new file mode 100644
index 00000000..28d89a82
--- /dev/null
+++ b/templates/pdf/footer.html.twig
@@ -0,0 +1 @@
+footer tadam
diff --git a/templates/pdf/header.html.twig b/templates/pdf/header.html.twig
new file mode 100644
index 00000000..44f607ad
--- /dev/null
+++ b/templates/pdf/header.html.twig
@@ -0,0 +1 @@
+header hopla
diff --git a/templates/pdf/table-of-contents.xml.twig b/templates/pdf/table-of-contents.xml.twig
new file mode 100644
index 00000000..4adc209d
--- /dev/null
+++ b/templates/pdf/table-of-contents.xml.twig
@@ -0,0 +1 @@
+